且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

指针事件禁用锚标记

更新时间:2023-12-05 20:34:58

要禁用链接,只需执行

$('#menu-item-747 a').click(function(e){
     e.preventDefault();
});

这不会阻止其他操作,只会阻止默认链接元素之一(即跟随链接).

This won't prevent other actions, just the default one of the link element (i.e. following the link).