[英]Preventing default click event in qtip2
I've created a link with a qtip2 tooltip using the following code: 我使用以下代码创建了一个带有qtip2工具提示的链接:
<a href="#" class="mylink">Show Tooltip</a>
$('.mylink').qtip({
show: {event: 'click'}
});
When the link is clicked, the tooltip opens as expected, but the browser also navigates to /#
, which causes the screen to scroll to the top. 单击链接后,工具提示将按预期方式打开,但是浏览器也会导航到/#
,这将导致屏幕滚动到顶部。 How can I prevent the original click event, without interfering with qtip? 如何在不干扰qtip的情况下防止原始点击事件?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.