javascript 如何在鼠标悬停时点击href链接?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16337076/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to get clicked a href link on mouseover?
提问by user2033281
how to get clicked a href link on mouseover?
如何在鼠标悬停时点击href链接?
i want to get clicked my link on mouseover
我想在鼠标悬停时点击我的链接
what i have to do to make my link get clicked on mouseover
我必须做什么才能让我的链接在鼠标悬停时被点击
this is my code:
这是我的代码:
<a href="www.example.com">link</a>
<a href="www.example.com">link</a>
回答by nicolas
try something like :
尝试类似:
<a onmouseover="this.click();" href="...">link</a>
回答by SrikanthManian
You can use jquery for achieving this manipulation
您可以使用 jquery 来实现这种操作
$('a').mouseover(function(){
$(this).click();
});
回答by Vedpathi
Jquery or Style attribute
Jquery 或 Style 属性
<a href="" onmouseover="$(this).click()" >Click Me</a>
<a href="" onmouseover="this.style.cursor='pointer';">Click Me</a>