jquery懸浮提示框完整實例
更新時間:2016年01月13日 16:29:26 作者:xpsharp
這篇文章主要介紹了jquery懸浮提示框實現(xiàn)方法,涉及jQuery鼠標事件響應及頁面元素樣式的動態(tài)操作技巧,需要的朋友可以參考下
本文實例講述了jquery懸浮提示框實現(xiàn)方法。分享給大家供大家參考,具體如下:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function() {
x = 5;
y = 15;
$("p").hover(function(e) {
otitle = this.title;
this.title = "";
var ndiv = "<div id='leo'>" + otitle + "</div>";
$("body").append(ndiv);
$("#leo").css({
"top" : (e.pageY + y) + "px",
"left" : (e.pageX + x) + "px"
}).show(2000);
$(this).mousemove(function(e) {
$("#leo").css({
"top" : (e.pageY + y) + "px",
"left" : (e.pageX + x) + "px"
}).show(1000);
});
}, function() {
this.title = otitle;
$("#leo").remove();
});
});
</script>
<style type="text/css">
#leo {
position: absolute;
border: 1px solid grey;
opacity: 0.8;
background: grey;
}
</style>
</head>
<body>
<p title="1dfgfdgdfg">If you click on me, I will disappear.</p>
<p title="2dgfdgdfgdf">If you click on me, I will disappear.</p>
<p title="3dgfdgfdgfder">If you click on me, I will disappear.</p>
<p title="4ghfghfghfhgf">If you click on me, I will disappear.</p>
</body>
</html>
希望本文所述對大家jQuery程序設計有所幫助。
相關文章
jquery實現(xiàn)簡單的banner輪播效果【實例】
下面小編就為大家?guī)硪黄猨query實現(xiàn)簡單的banner輪播效果【實例】。小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-03-03
利用jQuery實現(xiàn)滑動開關按鈕效果(附demo源碼下載)
這篇文章主要介紹了利用jQuery實現(xiàn)滑動開關按鈕效果,文中給出了詳細的介紹,并在文末給出了完整的demo源碼下載,有需要的朋友可以參考簡介,下面來一起看看吧。2017-02-02
使用jQuery給Table動態(tài)增加行、清空table的方法
這篇文章主要介紹了使用jQuery給Table動態(tài)增加行、清空table的方法,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下2018-09-09
jquery ui dialog實現(xiàn)彈窗特效的思路及代碼
這篇文章介紹了jquery ui dialog實現(xiàn)彈窗特效的思路及代碼,有需要的朋友可以參考一下2013-08-08

