小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

鼠標(biāo)跟隨提示框——取得鼠標(biāo)位置——兼容ie,ff,chrome

 昵稱39360 2011-04-14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www./TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www./1999/xhtml">
<head>
<title>鼠標(biāo)跟隨提示框</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
body{font:12px/1.8 arial;}
a,a:visited{color:#3366cc;text-decoration:none;}
a:hover{color:#f60;text-decoration:underline;}
.tip{width:200px;border:2px solid #ddd;padding:8px;background:#f1f1f1;color:#666;}
img{border:none;}
</style>
<script type="text/javascript">
var tip={$:function(ele){
    if(typeof(ele)=="object")
        return ele;
    else if(typeof(ele)=="string"||typeof(ele)=="number")
        return document.getElementById(ele.toString());
        return null;
    },
    mousePos:function(e){
        var x,y;
        var e = e||window.event;
        return{x:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:e.clientY+document.body.scrollTop+document.documentElement.scrollTop};
    },
    start:function(obj){
        var self = this;
        var t = self.$("mjs:tip");
        obj.onmousemove=function(e){
            var mouse = self.mousePos(e);    
            t.style.left = mouse.x + 10 + 'px';
            t.style.top = mouse.y + 10 + 'px';
            t.innerHTML = obj.getAttribute("tips");
            t.style.display = '';
        }
        obj.onmouseout=function(){
            t.style.display = 'none';
        }
    }
}
</script>
</head>
<body>
<ol>
<li>
<a target="_blank"><img src="http://www.jb51.net/images/logo.gif" onmouseover="tip.start(this)" tips="JQuery獲取元素文檔大小、偏移和位置和滾動(dòng)條位置的 " /></a>
</li>
<li>
<a target="_blank" onmouseover="tip.start(this)" tips="Javascript 實(shí)現(xiàn)TreeView CheckBox全選效果 ……">關(guān)于用戶研究的一點(diǎn)思考</a>
</li>
<li>
<a target="_blank" onmouseover="tip.start(this)" tips="JavaScript 學(xué)習(xí)筆記(九)call和apply方法 ……">WEB重構(gòu)拾趣</a>
</li>
</ol>
<div id="mjs:tip" class="tip" style="position:absolute;left:0;top:0;display:none;"></div>
</body>
</html>

詳細(xì)出處參考:http://www.jb51.net/article/21815.htm



    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約