這篇文章主要介紹了jQuery實現鼠標懸停顯示提示信息窗口的方法,涉及jQuery操作鼠標事件及show、hide等方法的使用技巧,需要的朋友可以參考下
本文實例講述了jQuery實現鼠標懸停顯示提示信息窗口的方法。分享給大家供大家參考。具體實現方法如下:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <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.49028c.com/</div>
- </body>
- </html>
希望本文所述對大家的jQuery程序設計有所幫助。
新聞熱點
疑難解答
圖片精選