Javascript Tooltip / Posts /

Same content on differents tooltips

0

Hi, I'm going to bother you again, I promise this is the last time. When I insert differents tooltips on the same page, the content of the tooltip box is the same, whereas it should be different. 

Here is an exemple : http://www.ebookboost.fr/1.1.html 

(same content on the first two tooltip boxes, while the code is this : 

<span class="tooltip" onmouseover="tooltip.pop(this, '#demo2_tip')"><strong>querelle</strong> </span> 

<div style="display:none;">

    <div id="demo2_tip"> dispute</div>

</div> 


and this : 

<span class="tooltip" onmouseover="tooltip.pop(this, '#demo2_tip')"><strong>brebis</strong> </span> 

<div style="display:none;">

    <div id="demo2_tip">

        <img src="images/brebis.png" style="float:right;" />

    </div>

</div>)

Florence  9 years ago   viewed: 2934    

5 Answers

0

Also, I have a line break after the target of the tooltip, how can I prevent that? Thanks in advance!

Florence   9 years ago
0

The id of an element on the page must be unique. You cannot have two <div id="demo2_tip">..</div> elements.

You have the line-break because you have closed the paragraph by </p>.

Milo   9 years ago
0

So, multiple tooltips with different contents on the same page aren't possible?

Florence   9 years ago
0

It is possible. But you should assign different IDs.

Milo   9 years ago
0

Ok, got it. Thanks a lot for taking the time to answer!

Florence   9 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: