DaveG wrote:
Jörn Zaefferer wrote:
DaveG wrote:
What I'd really like to do is maintain an array of tips, and
selectors, and then iterate through that calling Tooltip. I can do
that with the syntax above.
No, that won't work. The bodyHandler is supposed to be a callback
function that is called whenever a tooltip is to be displayed. On
the other hand, it would be easy to check if it is a string and use
that as the body.
Is there another parameter that parses out the title and the body
based on a ":" delimiter? I thought I read a post regarding that (of
course, now I can't find the post).
So what I'm looking for, basically, is a way to pass the tooltip
text in via a parameter, rather than from the 'title'. This will let
me maintain all tooltip text in a single place -- an array of
tips/selectors.
Could you provide some pseudo-code how you'd like to work with that?
I'm especially interested in the data format you're using, with the
idea in mind, that you can achieve what you want with the existing
features. I just need to take a look at your data to give you the
right idea.
Something like:
$(...).Tooltip({body: "some text for a hint -- no title needed"});
$(...).Tooltip({body: "some text for another hint."});
Of course, as I started playing around it occured to me that:
$(...).attr("title", "some text for a hint -- no title
needed").Tooltip();
should work equally well. I'll do a quick test tonight.
That seems like a nice solution, too.
NB: Some specific samples:
'Drag and drop the item image into the xyz or press the \'xyz\' button
to add items.'
'Click on \'Save This Search\' to add your current search to your
saved search list. Any searches in your Saved Searches can be used
again without you having to remember all of the details. Just click
the Saved Search name!'
'Click here to save your search'
I think my idea when asking for the data was if there is a link between
elements and their tooltips that can be used to automate the
association. You could have an object of key/value pairs, each key being
the same as an ID or class on an element, and the value containing the
value to display as a tooltip.
--
Jörn Zaefferer
http://bassistance.de