Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>CSS only allow elements to react on parent's hover (maybe siblings too, I'm not sure, if someone can tell).</p> <p>You'll have to use Javascript for this.</p> <p>For convenience, here's an example using jQuery :</p> <h2>HTML</h2> <pre><code>&lt;span data-tooltip-id="ref0"&gt;Reference 0&lt;/span&gt; ... &lt;div id="ref0"&gt;This is the reference 0&lt;/div&gt; </code></pre> <h2>Javascript</h2> <pre><code>$('.elements-to-hover').hover(function(){ var idRef = $(this).data('tooltip-id'); $('#'+idRef).addClass('yourBorderedClass'); },function(){ var idRef = $(this).data('tooltip-id'); $('#'+idRef).removeClass('yourBorderedClass'); }); </code></pre> <p>The first function is triggered on <code>mouseenter</code>, the second function on <code>mouseleave</code>.</p> <p>See <a href="https://www.google.fr/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CDAQFjAA&amp;url=http://api.jquery.com/hover/&amp;ei=feloUoOeA-PC0QXsuIGwAg&amp;usg=AFQjCNEIyQPzHZVNpBFlBiyQdRbg0gdCwg&amp;sig2=P8RaKlCZtH2KNwH-79kmAA&amp;bvm=bv.55123115,d.d2k" rel="nofollow">jQuery's <code>.hover()</code></a> for reference.</p> <h2>Edit</h2> <p>On your case, you'll bind this function to all your reference anchors :</p> <pre><code>$('#faq1link, #faq2link, #faq3link').hover(function(event){ var idRef = $(this).attr('href'); // or this.href $('#'+idRef).addClass('yourBorderedClass'); },function(){ var idRef = $(this).attr('href'); // or this.href $('#'+idRef).removeClass('yourBorderedClass'); }); </code></pre> <p><strong>I strongly suggest you</strong> to add either a common <code>class</code> to your <code>&lt;a&gt;</code>, or add a identifiable wrapper for these elements. It will allow you to bind <code>hover()</code> without specifying each <code>&lt;a&gt;</code> tag, using something like <code>$('.refAnchors')</code> or <code>$('.refAnchorsWrapper a')</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload