简体   繁体   English

jQuery本地内容未在所有提示中显示

[英]jquery local content not showing up in all cluetips

i'm working on a site which uses jquery v1.6.2. 我正在使用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. 但是,提示中的localcontent仅针对此类的前两个锚点显示。 i have simplified the problem down to the following code: ( jsfiddle here ) 我已经将问题简化为以下代码:( 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? 是cluetip不是要以这种方式工作,还是我做错了什么?

Try this 尝试这个

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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