javascript - tooltip doesn't work correctly -


<?php  foreach ($query $row){ echo  '<tr><td>     <label class="checkbox">     '.form_checkbox('delete[]', $row['link']).anchor("site/see_art/".$row['feed_id'],$row['title'],'class="abc"').     '<div class="tooltip-inner">'.$row['description'].'</div></td><td>'.substr($row['pub_date'], 5, 12).     '</label>     </td></tr>'     ; } ?> 

js:

$(".abc").mouseenter(function(){     cleartimeout($('.tooltip-inner').data('timeoutid'));     $('.tooltip-inner').show(200); }).mouseleave(function(){     var timeoutid = settimeout(function(){         $('.tooltip-inner').hide(200);     }, 650);     $('.tooltip-inner').data('timeoutid', timeoutid);  });  $(".tooltip-inner").mouseenter(function(){     cleartimeout($('.tooltip-inner').data('timeoutid')); }).mouseleave(function(){     var timeoutid = settimeout(function(){         $('.tooltip-inner').hide(200);     }, 650);     $('.tooltip-inner').data('timeoutid', timeoutid);  }); 

in view have table displayed titles. want display description of title when hover link. problem when hover on link displayed me description links. don't know how fix this.

this because of $('.tooltip-inner') selector - selects elements tooltip-inner class.

the div you're trying select (<div class="tooltip-inner">) sibling of anchor triggering event (<a class="abc"). select div, use siblings() method:

$(this).siblings(".tooltip-inner")... 

however need rework other parts of html , javascript have working.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -