我正在尝试根据锚标记的 id 属性调用不同的工具提示。我的 JavaScript 代码如下:
$(function()
{
$('.tippy').qtip(
{
content: {
url: "http://mydomain.com/product/mini/" + $(this).attr("id") // doesn't work
},
hide: { when: 'mouseout', fixed: true },
position: {
corner: {
target: 'bottomRight',
tooltip: 'topLeft'
}
}
});
});
我的 html 代码如下所示:
<div>this is the text and I would like to reference the <a href="product.php" class="tippy" id="123456">superproduct</a> with qtip.</div>
我卡住了,你能帮我一把吗?