jquery qtip插件

时间:2010-07-20 16:18:34

标签: jquery qtip

我正在使用jQuery qTip插件,并且无法从其他元素加载html内容。

我有以下代码:

$('.tip').qtip({
    content: { 
        text: $(this).next('.product_info').html() 
    }
});

使用以下html:

<a href="#" class="tip">An Image</a>
<div class="product_info">Some content</div>

问题是我似乎无法使用“$(this)”所以如何才能引用当前的“.tip”?

谢谢!

1 个答案:

答案 0 :(得分:1)

我认为这个问题的答案将为您解答: qtip jquery plugin to display text from link

基本上你需要循环你的东西到小费,然后单独提示,这将有效;

$('.tip').each(function(){
    $(this).qtip({
        content: { 
            text: $(this).next('.product_info').html() 
        }
     });
});
相关问题