后退按钮上时弹出

后退按钮上时弹出

本文介绍了鼠标悬停在浏览器栏/后退按钮上时弹出 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-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>

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

08-24 01:05