我在我正在处理的 RapidWeaver 主题上使用链接抑制器。 jQuery 代码如下。它所做的只是取消下拉菜单的父链接,这样就无法单击它们。不幸的是,“手”光标或 pointer
光标仍然出现!
// Link Suppressor script by Will Woodgate - visit willwoodgate.com for more information
$(document).ready(function(){
$("#nav li:has(ul)").hover(function() {
$(this).children("a").addClass("nolink").click(function(e) {
e.preventDefault();
});
});
});
我还想为 cursor:default;
添加样式,以便在将鼠标悬停在死链接上时显示正确的光标(默认光标)!我需要在 jQuery 中完成这部分样式。这是必不可少的。
谢谢!
最佳答案
当您向 a
元素添加类 nolink
时,您可以简单地在 CSS 中执行此操作:
.nolink { cursor: default; }
关于jquery - 光标在被抑制的链接上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14562028/