下面的超文本标记语言是通过ajax调用"purchase_content“生成的。我想应用工具提示到每行中的每个链接,可以多达100行。
这是目前的代码,但没有成功。如果我将每个链接滚动两次,工具提示就会出现,但永远不会再出现。对每一行的地址链接有什么想法吗?
<div id="purchase_content">
<div id="pr-listing">
<div id="pr-odd">
<table width="950" height="100" border="0" cellpadding="0" cellspacing="0">
<tr><td width="75" align="center" valign="middle">
<a href="#" id="avlink" title="3-5 Working Days">5-7 Days</a>
</td></tr>
</table>
</div>
<div id="pr-even">
<table width="950" height="100" border="0" cellpadding="0" cellspacing="0">
<tr><td width="75" align="center" valign="middle">
<a href="#" class="avlink" title="3-5 Working Days">Available Now</a>
</td></tr>
</table>
</div>
</div>
</div>
$('a.avlink').live('mouseover', function(e) {
var target = $(e.target);
return $(target).tooltip({
track: true,
delay: 0,
opacity: 0.9,
showURL: false,
showBody: " - ",
extraClass: "pretty",
fixPNG: true,
left: -120
});
});
发布于 2010-10-05 15:17:22
在ajax成功处理程序中,尝试添加如下内容,
$('a.avlink').not('.hasToolTip') // hasToolTip with a dot in it
.addClass('hasToolTip') // hasToolTip without a dot in it
.tooltip({
track: true,
delay: 0,
opacity: 0.9,
showURL: false,
showBody: " - ",
extraClass: "pretty",
fixPNG: true,
left: -120
});
发布于 2010-10-05 17:53:22
我在每个链接外的< td >中添加了一个id "pr-cell“,并为每个链接添加了唯一id的所有标签,感谢您的帮助。
$('#pr-cell > a').live('mouseover', function(e) {
$('#pr-cell > a').not('.hasToolTip')
.addClass('hasToolTip')
.tooltip({
track: true,
delay: 0,
opacity: 0.9,
showURL: false,
showBody: " - ",
extraClass: "pretty",
fixPNG: true,
left: -120
});
});
https://stackoverflow.com/questions/3861509
复制相似问题