Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Tooltip doesn't work on a new ajax append element
    primarykey
    data
    text
    <p>I have this jQuery tooltip that works fine on initial page loads. The problem is when I AJAX append another [tooltipwrapper] block the tooltip doesn’t work on it. Please see codes below, any suggestion would be greatly appreciated!</p> <pre><code>$(function() { $('.tooltipwrapper').each(function () { var $tip = $('&gt; .info-block', this); var $span = $('&gt; span', this); if (!$span.length) { var $span = $('&gt; a', this); }; var $old_html = $tip.html(); var $new_html = '&lt;div class="box-i-l"&gt;&lt;div class="box-i-r"&gt;&lt;span class="box-i"&gt;' + $tip.html() + '&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;'; $(this).hover(function () { $span.addClass('act'); $tip.html($new_html); if ($.browser.msie &amp;&amp; $.browser.version &lt; 9) { $tip.show(); } else { $tip.css('display', 'none'); $tip.stop().fadeTo(300, 1);} }, function () { $span.removeClass('act'); if ($.browser.msie &amp;&amp; $.browser.version &lt; 9) { $tip.hide(); $tip.html($old_html); } else { $tip.css('display', 'block'); $tip.stop().fadeTo(50, 0, function() {$tip.css('display', 'none'); $tip.html($old_html);}); } }); }); }); &lt;div class="tooltipwrapper"&gt; &lt;span class="ico_link #tstatus#"&gt;&lt;/span&gt; &lt;div style="opacity: 0; display: none;" class="info-block"&gt; &lt;span class="statusTitle"&gt;TASK STATUS&lt;/span&gt;&lt;br /&gt; &lt;a id="1" href="javascript:;" rel="Queue" class="TaskStatusUpdate"&gt;Queue&lt;/a&gt; &lt;a id="1" href="javascript:;" rel="Working" class="TaskStatusUpdate"&gt;Working&lt;/a&gt; &lt;a id="1" href="javascript:;" rel="Completed" class="TaskStatusUpdate"&gt;Completed&lt;/a &lt;a id="1" href="javascript:;" rel="Onhold" class="TaskStatusUpdate"&gt;On-hold&lt;/a&gt; &lt;a id="1" href="javascript:;" rel="Canceled" class="TaskStatusUpdate"&gt;Cancel&lt;/a&gt; &lt;/div&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