在网站建设过程中经常会用到鼠标悬停显示提示信息,今天绵阳动力网络公司为你介绍关于jQuery实现鼠标悬停显示提示信息窗口的方法,涉及jQuery操作鼠标事件及show、hide等方法的使用技巧,需要的朋友可以参考下:
<html>
<head>
<title>鼠标悬停显示提示信息窗口</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<style type="text/css">
.contact{width:100px;height:15px; margin:20px 0 0 50px;background-color:#CCCCCC; text-align:center; }
.us{display:none;width:300px;height:40px; padding:10px;position:relative;top:0px;left:50px; background-color:#0099FF; }
</style>
<script src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".contact").mouseover(function(){
$(".us").show("slow");
$(".contact")
.mouseout(function(){
$(".us").hide("slow");
});
});
})
</script>
</head>
<body>
<div class="contact">联系我们</div>
<div class="us">提示内容!提示内容!提示内容!</div>
<div>http://www.webmy.cn/</div>
</body>
</html>