One Javascript Demo
2010-01-04 13:30
288 查看
<div id="a1" style=" position:absolute; z-index:2;"></div>
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="白羊.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'白羊.jpg','白羊座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="金牛.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'金牛.jpg','金牛座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="双子.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'双子.jpg','金牛座~')" onmouseout="hide(this)" /></td>
</tr>
<tr></tr>
<tr>
<td><img src="巨蟹.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'巨蟹.jpg','巨蟹座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="狮子.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'狮子.jpg','狮子座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="处女.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'处女.jpg','处女座~')" onmouseout="hide(this)" /></td>
</tr>
<tr></tr>
<tr>
<td><img src="天秤.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'天秤.jpg','天秤座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="天蝎.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'天蝎.jpg','天蝎座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="射手.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'射手.jpg','射手座~')" onmouseout="hide(this)" /></td>
</tr>
<tr></tr>
<tr>
<td><img src="摩羯.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'摩羯.jpg','摩羯座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="水瓶.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'水瓶.jpg','水瓶座~')" onmouseout="hide(this)" /></td>
<td></td>
<td></td>
<td></td>
<td><img src="双鱼.jpg" alt="hi.baidu.com/liwya" onmousemove="show(event,'双鱼.jpg','双鱼座~')" onmouseout="hide(this)" /></td>
</tr>
</table>
<script>
function show(event,_this,mess) {
event = event || window.event;
var t1="<table cellspacing='1' cellpadding='10' style='border-color:#CCCCCC;background-color:#FFFFFF;font-size:12px;border-style:solid; border-width:thin;text-align:center;'><tr><td><img src='" + _this + "' width='300' height='225' > <br>"+mess+"</td></tr></table>";
document.getElementById("a1").innerHTML =t1;
//document.getElementById("a1").innerHTML = "<img src='" + _this.src + "' >";
document.getElementById("a1").style.top = document.body.scrollTop + event.clientY + 10 + "px";
document.getElementById("a1").style.left = document.body.scrollLeft + event.clientX + 10 + "px";
document.getElementById("a1").style.display = "block";
}
function hide(_this) {
document.getElementById("a1").innerHTML = "";
document.getElementById("a1").style.display = "none";
}
</script>
相关文章推荐
- javascript实现文本框默认内容Demo
- Soft-Rigid-Vehicle Demo all in one
- javascript中间凸显滚动圆圈特效demo
- JavaScript版经典游戏之扫雷游戏完整示例【附demo源码下载】
- javascript 之一个简单的画图demo
- JavaScript_HTML DEMO_1_概念
- [one_demo_7]求走到第50个台阶的走法多少种
- JavaScript 随机数记录demo
- [LeetCode][JavaScript]Number of Digit One
- Javascript继承Demo
- CEF:JavaScript 调用 C++ 函数 Demo(VS2013)
- ASP.NET DEMO 10: 如何通过 javascript 访问 GridView/DataGrid 选中 CheckBox 行各列的值
- GoogleMaps api for javascript demo 动态按顺序加载marker
- WebView使用与JavaScript交互详解(附完整Demo代码)
- <四>基于淘宝Fourinone实现集群管理demo
- Android WebView与JavaScript交互操作(Demo)
- Demo_javascript_注册表单校验
- Android webview中JavaScript与Java方法的相互调用Demo
- 【转】265行JavaScript代码的第一人称3D H5游戏Demo
- JavaScript Google IG Drag Demo