我在 dev.tsecashmere.com 上使用了以下代码,以便以前创建该网站的人获得工具提示悬停。
但是,在 tsecashmere.com 的生产版本中,我似乎无法摆脱 <p>
标签,因此工具提示不起作用。
如何选择 <p>
下面的欢迎消息标签?或者我做错了什么?
提前致谢。
<p><a class="welcome-msg" href="#">FREE SHIPPING & GUARANTEED HOLIDAY DELIVERY</a></p>
<script type="text/javascript">// <![CDATA[
$j(document).ready(function() {
$j('.welcome-msg').tooltip({
tooltipClass: 'blueTooltip',
content: function() {
return '\<div style\=\"text-align:left\"\>\*Free ground shipping offer valid on all online purchases from November 29, 2013 through January 5, 2014. Offer not valid at TSE or TSE Factory stores. Valid on shipments to addresses in the continental US only. Offer does not apply to previous purchases.The last days to ship and ensure your order will arrive on or before Wednesday, Dec. 25 will depend on the shipping method selected.\<br \/\>\<br \/\> Standard Ground (3 to 7 Business Days) - order on or before 12/16/13\<br \/\>\n2nd Business Day - order on or before 12/19/13\<br \/\>\nNext Business Day - order on or before 12/20/13\<br \/\>\<br \/\>Guaranteed Holiday Delivery is available for orders shipped to locations within the continental/contiguous 48 US states. Delivery has been guaranteed from the shipping carrier which indicates a 12/25/13 delivery date.\<\/div\>';
}
});
});
// ]]></script>
最佳答案
工具提示不起作用,因为 jQuery UI 需要标题属性,即使它是空的。您的 jQuery 代码选择 .welcome-msg
元素很好,但工具提示本身没有应用。将 HTML 更改为此,它应该可以工作:
<p><a class="welcome-msg" href="#" title="">FREE SHIPPING & GUARANTEED HOLIDAY DELIVERY</a></p>
关于javascript - 如何选择 P 标签下方的类,Jquery 工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27161953/