js实现div跟谁鼠标悬浮移动显示
2011-11-07 16:56
330 查看
js实现div跟谁鼠标悬浮移动显示 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <style>
4 #hint{
5 width:198px;
6 border:1px solid #000000;
7 background:#99ff33;
8 position:absolute;
9 z-index:9;
padding:6px;
line-height:17px;
text-align:left;
top:1520px;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showme(){
var oSon = window.document.getElementById("hint");
if (oSon == null) return;
with (oSon){
innerText = guoguo.value;
style.display = "block";
style.pixelLeft = window.event.clientX + window.document.body.scrollLeft + 6;
style.pixelTop = window.event.clientY + window.document.body.scrollTop + 9;
}
}
function hidme(){
var oSon = window.document.getElementById("hint");
if(oSon == null) return;
oSon.style.display="none";
}
//-->
</SCRIPT>
<BODY>
<text id="guoguo" value="ga">
<a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br><br><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br>
<div id="hint" style="display:none"></div>
</BODY>
</HTML>
2 <HTML>
3 <style>
4 #hint{
5 width:198px;
6 border:1px solid #000000;
7 background:#99ff33;
8 position:absolute;
9 z-index:9;
padding:6px;
line-height:17px;
text-align:left;
top:1520px;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showme(){
var oSon = window.document.getElementById("hint");
if (oSon == null) return;
with (oSon){
innerText = guoguo.value;
style.display = "block";
style.pixelLeft = window.event.clientX + window.document.body.scrollLeft + 6;
style.pixelTop = window.event.clientY + window.document.body.scrollTop + 9;
}
}
function hidme(){
var oSon = window.document.getElementById("hint");
if(oSon == null) return;
oSon.style.display="none";
}
//-->
</SCRIPT>
<BODY>
<text id="guoguo" value="ga">
<a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br><br><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br> <a href="#" onmouseover="showme()" onmouseout="hidme()" onmousemove="showme()">dfdfd</a><br>
<div id="hint" style="display:none"></div>
</BODY>
</HTML>
相关文章推荐
- css,js实现在鼠标移动到一个位置在这个位置下面显示一个已经存在的div,这个div的位置随意
- JS实现鼠标移动到缩略图显示大图的图片放大效果
- 点滴积累【JS】---JS小功能(onmousedown实现鼠标拖拽div移动)
- js实现的跟随鼠标移动的时钟效果(中英文日期显示)
- js 实现 鼠标 移动 div
- js+html+css实现鼠标移动div实例
- 鼠标移动到div上显示子div实现要点
- js实现的跟随鼠标移动的时钟效果(中英文日期显示)
- js中实现div跟随鼠标移动
- JS实现鼠标拖动div移动
- js 实现div跟随鼠标移动
- css实现 : 鼠标移动上去显示div,移开隐藏div
- JS+CSS实现感应鼠标渐变显示DIV层的方法
- JS实现鼠标移动到缩略图显示大图的图片放大效果
- js+css样式表实现鼠标移动变换显示内容效果
- JS实现div随着鼠标移动
- JS+CSS实现感应鼠标渐变显示DIV层的方法
- Js实现div跟着鼠标的移动