JavaScript 和 href
假设我在最后一个 div 之后有以下下拉菜单,单击后会出现一个下拉菜单。
<div id="test"> <a href="clickthrough.php">Arrow</a> </div>
我希望用户能够单击此元素并出现下拉列表,而且如果他单击中间也能够直接在新选项卡中打开此链接。换句话说,我想阻止默认操作 onclick 但仍然在悬停或其他情况下显示元素的链接。
谢谢
Let's suppose that I have the following dropdown after the last div, a dropdown menu appears once he clicks.
<div id="test"> <a href="clickthrough.php">Arrow</a> </div>
I want the user to be able to click on this element and the dropdown appear but also if he mid clicks to be able to open this link directly in a new tab. In other words I want to prevent the default action onclick but still show the link of the element on hover or whatever.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以做
you can do
使用 jquery 1.7+
with jquery 1.7+