c# - Using a jquery tooltip more than once on the same page -
i using jquery tooltip on asp.net repeater element.
<div class="tooltip" style="display: none"> <div style="text-align: center; font-weight: bold;"> <%# eval("name") %><br /> </div> </div> $(function () { var du = 1000; var tooltip; $(document).tooltip({ show:{effect:'slidedown'}, items: "h5", content: function () { tooltip = $(this).siblings('.tooltip'); return tooltip.html(); } }); });
i have implement functionality. there should icon , on clicking on icon popup should open instructions , use jquery tooltip again. not know how implement time ,should include in same $function() above or should use function ?
if has idea please let me know..
the way you've written it, shouldn't have more javascript. <h5>
element has sibling tooltip
class activated. have put .tooltip
div next thing that's supposed activate it. example:
<ul> <li> <h5>here thing 1.</h5> <div class="tooltip" style="display: none">this tooltip 1.</div> </li> <li> <h5>here thing 2.</h5> <div class="tooltip" style="display: none">this tooltip 2.</div> </li> </ul>
if want tooltips work elements other h5
, modify items
option:
items: "h5, img.help-icon",
make sure each trigger/tooltip pair siblings, , make sure have type of wrapper around each pair show tooltip goes element. example, not work properly:
<li> <div> <h5>here thing 1.</h5> </div> <div class="tooltip" style="display: none">this won't show @ all!</div> </li>
neither this:
<li> <h5>here thing 1.</h5> <div class="tooltip" style="display: none">this text both tooltips!</div> <h5>here thing 2.</h5> <div class="tooltip" style="display: none">this won't show @ all!</div> </li>
Comments
Post a Comment