简体   繁体   English

鼠标悬停时如何打开链接

[英]How To Open link when mouse hover

当鼠标悬停在“单击此处”上方时,如何使该链接<a href="www.site.com">Click here</a>打开链接?

HTML one line solution: HTML单行解决方案:

<a href="http://www.google.com" onmouseover="click();">Click here</a>

We are using inline events with Javascript, triggering the click event to the current link element, when mouse hovering. 我们将内联事件与Javascript一起使用,当鼠标悬停时,将触发click事件触发到当前链接元素。

To learn more: http://www.w3schools.com/jsref/event_onmouseover.asp 要了解更多信息: http : //www.w3schools.com/jsref/event_onmouseover.asp

You can give that element a name like name='blah'. 您可以为该元素命名,例如name ='blah'。 Then access it using javascript andtake advantage of the javascript MouseOver event. 然后使用javascript访问它并利用javascript MouseOver事件。 For more information on that just google it, it's everywhere. 有关只是谷歌的更多信息,它无处不在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM