简体   繁体   中英

jquery local content not showing up in all cluetips

i'm working on a site which uses jquery v1.6.2. i want to show a cluetip using local content for all anchors of a given class. however the localcontent in the cluetip is only showing up for the first two anchors of this class. i have simplified the problem down to the following code: ( jsfiddle here )

$(function() {
    $('a.triggerxxx').cluetip({
        activation: "click",
        cluetipClass: "jtip",
        local: true,
        hideLocal: true,
        sticky: true
    });
});

<a class="triggerxxx" href="#" title="cluetip title" rel="div.cluetip-contentxxx">trigger text 1</a><br>
<a class="triggerxxx" href="#" title="cluetip title" rel="div.cluetip-contentxxx">trigger text 2</a><br>
<a class="triggerxxx" href="#" title="cluetip title" rel="div.cluetip-contentxxx">trigger text 3</a><br>
<a class="triggerxxx" href="#" title="cluetip title" rel="div.cluetip-contentxxx">trigger text 4</a>
<div class="cluetip-contentxxx">this content should show in all cluetips, but it only shows up in the first two</div>

is cluetip not meant to work this way, or am i doing something wrong?

Try this

$(function() {
    $('a.triggerxxx').each(function(index) {
       $(this).cluetip({
        activation: "click",
        cluetipClass: "jtip",
        local: true,
        hideLocal: true,
        sticky: true
        }); 
    });
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM