You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Specify Multiple Tool Tips Created Feb 10, 2010

This thread is solved

Views: 1502     Replies: 3     Last reply Mar 3, 2010  
You must login first before you can use this feature

nile

Posts: 2

Registered:
Feb 10, 2010

Specify Multiple Tool Tips

Posted: Feb 10, 2010

Can you please provide an example of how to specify multiple tool tips by the ID of the tooltip? The tooltip that is displayed can have an ID based on the ID of the trigger - for example: trigger ID = "email", tooltip ID = "email_tooltip".

I want to use tooltips to show tips for form input fields. Each tip will contain a form, and because nested forms are not permitted in HTML, I cannot position the tip next to the trigger that owns it.

tnoetzel

Posts: 4

Registered:
Feb 17, 2010

» Specify Multiple Tool Tips

Posted: Feb 17, 2010

Reply to: Specify Multiple Tool Tips, from nile
I'm having a similar issue... would like multiple HTML tooltips within Scrollable.

Can't use a class because placing classed elements next to each scrollable item breaks scrollable (I assume because it's messing with the width).

I'm thinking it would be easiest to point multiple IDs, but other solutions are also welcome.

nile

Posts: 2

Registered:
Feb 10, 2010

Solution found...

Posted: Feb 25, 2010

Reply to: Specify Multiple Tool Tips, from nile
I figured out how to do this. The following example will work on all inputs on the page, automatically, and assign a unique tooltip for each one, the ID of the tooltip the same as the trigger ID plus "_tooltip".


If you copied the code below, and used a trigger with id "username", then your tooltip would have to have id "username_tooltip" and it would function... and so on: "password" = "password_tooltip", "email" = "email_tooltip", etc.


$(":input").each(function(){  
   var el = $(this); 
   var thisid = el.attr("id");
   var thisid = ("#" + thisid + "_tooltip");
 
   el.tooltip({  
      offset: [5, 70],  
      tip: thisid
   }); 
 
});

peterbutler

Posts: 3

Registered:
Sep 28, 2009

» Solution found...

Posted: Mar 3, 2010

Reply to: Solution found..., from nile
That works nile, but is that really the best way to do it?

I feel like this *should* work (note - it doesnt work, but it seems to me that it ought to)


   $(":input").tooltip({   
      offset: [5, 70],   
      tip: "#"+$(this).attr("id")+"_tooltip"
   });  

Does this make sense to anybody else?