[jQuery] Re: [tooltip] Looping and variable tooltip setup

2008-02-23 Thread spinnach
derek, i haven't thoroughly examined how bodyHandler works but i think something like this should work, provided that your html structure won't change: $('div[id^=tt]').tooltip({ bodyHandler: function(){ return $(this).next().html(); } }); if your html structure will change, you

[jQuery] Re: [tooltip] Looping and variable tooltip setup

2008-02-23 Thread derek
dennis, Thanks for the help, both of your examples work great. I also tried substituting in a class 'tt' in place of the individual ids and that seems to work good as well. Is there any speed advantage to this method? I'll probably end up using this method instead as it seems more elegant.

[jQuery] Re: [tooltip] Looping and variable tooltip setup

2008-02-23 Thread spinnach
derek, i'm not sure if there are any speed advantages (in both cases jquery has to loop through all divs on the page to find the ones you need - either by class or by id, so there probably is none) but by using classes your keeping your html cleaner.. as a rule, things that repeat on a