Not sure if I'm explaining this correctly or following the instructions, but if you have more than one element with a tooltip, and use the child selector method, then all of the elements get a tooltip but the content of the tooltip is the content from the tooltip for the very first element. In other words, the selectors are wrong somewhere and are not made to expect that there would be more than one matching element. I'm having a little trouble tracing all the jQuery around since it's like a 20 step process to actually go from the selector (as specified in the settings) to obtaining the content from the child element...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Michsk’s picture

Yes i can confirm this. Using a class as a selector does not inherit the title from the defined class. For me (D6), it only shows the first tooltip and the other elements don't even show a tooltip.

Michsk’s picture

The drupal form elements seem to behave correctly.

//edit: strange there are even more elements that behave as expected. Just when using a view with custom themeing, applying theme(imagecache) to the themeing, and that breaks it.

//edit: lol i forgot to give them a title. So i do not have this issue.

elianm’s picture

I'm having this issue as well, multiple items with child element ".class" as a selector, get the same tooltip content of the first item.

What do you mean when you say "you forgot to give them a title" ?

Michsk’s picture

i forgot to give the elements a title....

alextrejo’s picture

I was having this issue, plus the tooltip didn't stay open while mouse was inside the tooltip. I solved it by adding a javascript code to the page where I want the tooltip to work.

The code I wrote is for child element selector, not for attribute selector. Feel free to modify the code to work with attribute if you need to. Hope this code helps

alextrejo’s picture

FileSize
896 bytes

Sorry, didn't attach the file. Here you are

mstrelan’s picture

Title: Multiply tooltips get stuck with title from first » Multiple tooltips on one page all show the first tooltip when using child element as the tooltip source
Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Priority: Normal » Major
Status: Active » Needs review
FileSize
453 bytes

This is such a simple fix, just apply the attached patch.

Yurii’s picture

Priority: Major » Normal

Patch #7 working for me. Thanks.

Vote_Sizing_Steve’s picture

Patch #7 works to show the right data, but the module I had my developer write #5 & 6 also had the hovertext stay visible long enough for users to click on links inside it. Any suggestions on how to include that in a patch like #7?

mstrelan’s picture

That's a different issue. I haven't had a good look at what #5 or #6 does, but there is a setting in the Tipsy configuration for delay before disappearing. Set that to 500 or 1000 or something and this might achieve what you want.

Blue’s picture

Patch #7 worked

izus’s picture

patch #7 worked fine for me
thanks mstrelan

boabjohn’s picture

#7 works for me.
Filing new info on the thread for the MouseIn/Out function to keep the tooltip open...see: http://drupal.org/node/1678254

Dexter0015’s picture

Title: Multiple tooltips on one page all show the first tooltip when using child element as the tooltip source » #7 works for me.

Thanks for the patch (#7) it works fine !

izus’s picture

Status: Needs review » Reviewed & tested by the community
CodigoVision’s picture

Title: #7 works for me. » Multiple tooltips on one page all show the first tooltip when using child element as the tooltip source

Just changing the title back

sigveio’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
449 bytes

I found that the patch in #7 did not work very well in my case, where the child selector were for an element that is a grandchild of the parent.

An example scenario is that you have the main tipsy selector set to ".foo-bar", the tooltip content set to "Child element" and a (child) selector of ".title-element", with the following markup:

<label class="foo-bar">
  <span>
    <span>meh</span>
    <span class="title-element">This is the title you want in the tooltip</span>
  </span>
</label>

The .children() jQuery selector of #7 wouldn't be able to target the .title-element - because .children() only travels a single level down the DOM tree.

I have therefore created a patch using .find() instead - which, unlike .children(), can traverse down multiple levels to select descendant elements (grandchildren, etc) as well.

It seems to work well for the various cases/selectors I have on the project I am working on, but I don't have opportunity to test it very thoroughly. Would appreciate if someone else can give it a test and verify. Thanks!

golddragon007’s picture

Issue summary: View changes

#17 works for me, it found the 3rd child

ram4nd’s picture

Status: Needs review » Needs work

Can you re-roll it against the latest dev? I am not able to find such lines at all.