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

Your preferred username that is used when logging in.

Using text as the trigger for tooltips (& repeating the tooltip) Created Aug 6, 2010

This thread is solved

Views: 1213     Replies: 4     Last reply Aug 23, 2010  
You must login first before you can use this feature

greenbluewave

Posts: 6

Registered:
Aug 6, 2010

Using text as the trigger for tooltips (& repeating the tooltip)

Posted: Aug 6, 2010

Hi, I know this is probably a dumb question, but I can't find examples of using text as triggers.

I want the word "SEO" within sentences to pull up a tooltip when you hover over it.

Basically, I want it to work just like here dynamically:
http://flowplayer.org/tools/demos/tooltip/dynamic.htm

Except instead of images; a word within a sentence would be the trigger. Also, I want the same tooltip to come up whereever the word SEO appears in a sentence throughout the page. How would I do that with a class or something?

Do I just need to change something in this part of the code here?

img src=http://static.flowplayer.org/tools/img/photos/1.jpg"
title="A must have tool for designing better layouts and more intuitive user-interfaces."


I've been searching for hours on the site and forums, I would greatly appreciate help with this.

Nutshell: How do I change the trigger above to be a word within a sentence instead of an image, etc.? And, then use the same tooltip for that word throughout the webpage?

It's really strange, I see example for images, checkboxs, forms, etc. ... but no example for text? Please somebody... :D

anoriega

Posts: 7

Registered:
Aug 6, 2010

» Using text as the trigger for tooltips (& repeating the tooltip)

Posted: Aug 7, 2010

Reply to: Using text as the trigger for tooltips (& repeating the tooltip), from greenbluewave
You could just put the word in a span like this: <span id="whatever" title="tooltip text here">WORD</span>.

Then in your tooltip javascript call do it like this:

$("span#whatever[title]").tooltip({effect: 'slide'});

greenbluewave

Posts: 6

Registered:
Aug 6, 2010

» » Using text as the trigger for tooltips (& repeating the tooltip)

Posted: Aug 10, 2010

Reply to: » Using text as the trigger for tooltips (& repeating the tooltip), from anoriega
Thank you so much for the span tag info, it works great! Now I'm just wondering how I can have different tooltips with different styled bubbles, etc. come up for other words in the same webpage?

greenbluewave

Posts: 6

Registered:
Aug 6, 2010

» » » Using text as the trigger for tooltips (& repeating the tooltip)

Posted: Aug 22, 2010

Reply to: » » Using text as the trigger for tooltips (& repeating the tooltip), from greenbluewave
Or if someone can please direct me to some code I can look at I would deeply appreciate it. :)

randyfyfe

Posts: 17

Registered:
Aug 17, 2010

» » » » Using text as the trigger for tooltips (& repeating the tooltip)

Posted: Aug 23, 2010

Reply to: » » » Using text as the trigger for tooltips (& repeating the tooltip), from greenbluewave
a poorly documented attribute for the tooltips is "tipClass:"

read about it here:
http://flowplayer.org/tools/tooltip/index.html

basically you can specify the class that the tooltip div will have. by default it is "tooltip" so you have css like
 .tooltip {*css code here*}

so you will need a second slector to call .tooltip and specify a different tipClass (like "tooltip2") and then you can have separate css code like:

 .tooltip {*other css code here*}