JS特效鼠标移入显示移出隐藏代码

 分类:js知识时间:2015-11-01 15:27:08点击:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
function MM_over(mmObj) {
var mSubObj = mmObj.getElementsByTagName("div")[0];
mSubObj.style.display = "block";
mSubObj.style.backgroundColor = "#f60";
}
function MM_out(mmObj) {
var mSubObj = mmObj.getElementsByTagName("div")[0];
mSubObj.style.display = "none";
 
}
</script>
 
</head>
 
<body>
<div onmouseover="MM_over(this)" onmouseout="MM_out(this)" style="width:100px;position:relative;">sdfsdf
<div style="width:100px;height:100px;display:none;position:absolute;left:0;top:15px;z-inde:5;"><p><a href="#">ssss</a></p><p><a href="#">ssss</a></p></div>
</div>
</body>
</html>
 
除注明外的文章,均为来源:老汤博客,转载请保留本文地址!
原文地址: