当鼠标悬停在浏览器栏/后退按钮上时,JavaScript弹出 [英] Javascript Pop-Up when Mouse Hovers toward Browser Bar/Back Button

查看:63
本文介绍了当鼠标悬停在浏览器栏/后退按钮上时,JavaScript弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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-teaching-of-emotions-and-意义

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

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>

这篇关于当鼠标悬停在浏览器栏/后退按钮上时,JavaScript弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆