moreinet
moreinet

Reputation: 55

Multiple Tools Tip Effect

I need to make the tool tip more than one tools tip in jQuery, but I'm very new with this can some one help me out of the problem please.

  <script>
   $(document).ready(function() {
   $("#menu_eric").tooltip({ effect: 'fade'});
  });
 </script>


 <!-- Link 1 Image 1 -->
  <a id="menu_eric">Link 1 </a>
 <img class="tooltip" src="mouse_hover_pic1.jpg">




 <!-- Link 2 Image 2 -->
    <a id="menu_eric">Link 2 </a>
    <img class="tooltip" src="mouse_hover_pic2.jpg">

Upvotes: 0

Views: 103

Answers (2)

sebbl.sche
sebbl.sche

Reputation: 321

Are both images in the same div-container?

If they are you could leave out the id attribute of the images and use this:

$('#IdOfYourDivContainer img').tooltip({ effect : 'fade'});

It's always better not to use so many IDs and classes

Upvotes: 1

SickHippie
SickHippie

Reputation: 1402

Well, you can't have two items with the same id - that's your biggest issue there. Change id= to class=, then change $("#menu_eric") to $(".menu_eric").

Alternately, give your two <a> tags different id's - menu_eric1 and menu_eric2, for example. Then either call $("#menu_eric1").tooltip({ effect: 'fade'}); $("#menu_eric2").tooltip({ effect: 'fade'}); or $("#menu_eric1, #menu_eric2").tooltip({ effect: 'fade'});

If these don't fix your issue, it would help to know which of the 30+ jQuery tooltip plugins you're using.

Upvotes: 0

Related Questions