Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery tooltips not appearing when mouse is hovering over text
    primarykey
    data
    text
    <p>I'm following this <a href="http://3nhanced.com/javascript/simple-tooltip-powered-by-jquery/" rel="nofollow">tutorial</a> to add a simple jquery tooltip. The tutorial uses three images to construct the tooltip background but I only want to use one. Right now I'm trying to make the tooltip appear when I hover over certain text. I don't know if I'm making a simple mistake or if the code doesn't make sense. Either way, the tooltip won't appear when I hover over the text.</p> <p>Here is my version of the script:</p> <pre><code>&lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('.toolTip').hover( function() { this.tip = this.title; $(this).append( '&lt;div class="toolTipWrapper"&gt;' +'&lt;div class="toolTipPic"&gt;' +this.tip +'&lt;/div&gt;&lt;/div&gt;' ); this.title = ""; this.width = $(this).width(); $(this).find('.toolTipWrapper').css({left:this.width-22}) $('.toolTipWrapper').fadeIn(300); }, function() { $('.toolTipWrapper').fadeOut(100); $(this).children().remove(); this.title = this.tip; } ); }); &lt;/script&gt; &lt;style type="text/css"&gt; .toolTip {} .toolTipWrapper { width: 175px; position: absolute; top: 20px; display: none; color: #FFF; font-weight: bold; font-size: 9pt; } .toolTipPic { width: 175px; background: url(tooltip.png) no-repeat; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;p class="toolTip" title="This is the tooltip text"&gt;Hover over me for tooltip &lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload