鼠标悬停在浏览器栏/后退按钮上时弹出 Javascript

2022-01-20 00:00:00 popup hover javascript mouseover

我想在这个页面上模仿这个确切的功能.(将鼠标移向顶部浏览器栏)

I would like to imitate this exact feature on this page. (Move mouse toward the top browser bar)

http://my-personal-growth.com/personal-growth/what-anthony-robbins-teaches-about-emotions-and-meaning

我想我只需要知道如何创建鼠标悬停动作,其余的我应该能够自己处理.

I guess all i need to know is how to create the hovering mouse action, the rest I should be able to handle myself.

有教程吗?我不懂js.

Any tutorials? I don't know js.

谢谢大家.

推荐答案

您可以使用 window.onmouseout 事件或在您正在使用的页面上的元素上使用 onmouseout.

You could use window.onmouseout event or use onmouseout on the elements on the page you are using.

类似这样的:

<html>
<head>

<title>onmouseout test</title>

<style type="text/css">
.my_box { border: 1px solid red; }
</style>

<script type="text/javascript">

window.onmouseout = mouseout;

function mouseout()
{
 alert("mouseout event detected!");
}
</script>
</head>

<body>
<div class="my_box">
<p>move the mouse pointer away from the element it is on<br />
to fire the mouseout event.</p>
</div>
</body>
</html>

相关文章