我使用http://plugins.learningjquery.com/cluetip插件和jtip类
html代码:
<a class="jt" href="ajax6.html" rel="ajax6.html" title="jTip Style!">
and jquery :
$('a.jt:eq(0)').cluetip({
cluetipClass: 'jtip',
arrows: true,
dropShadow: false,
hoverIntent: false,
sticky: true,
mouseOutClose: true,
closePosition: 'title',
closeText: '<img src="cross.png" alt="close" />'
});但是,当我想在jt班上使用2个或更多的时间时,只需在第一个班级工作,例如:
<a class="jt" href="ajax6.html" rel="ajax6.html" title="jTip Style!">
<a class="jt" href="ajax5.html" rel="ajax5.html" title="jTip Style!">仅ajax6已加载并显示工具提示,而ajax5未加载工具提示
发布于 2013-01-29 00:49:09
这是因为您的代码显式地指示它只应用于第一个<a>。
去掉选择器中的":eq(0)“。
$('a.jt').cluetip({ ...发布于 2013-01-29 00:54:25
Pointy是对的,代码中的eq将匹配元素的集合减少到指定索引处的元素。这就是为什么你不能捕获所有元素的原因。
https://stackoverflow.com/questions/14566886
复制相似问题