<!DOCTYPE>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">
.man{height:210px;width:104px;}
#a{height:100px;width:50px;float:left;margin:0 4px 4px 0; background-color:gray;}
#b{height:204px;width:50px;float:right;background-color:gray;}
#c{height:100px;width:50px;float:left;background-color:gray;}
.biger{background-color:#cc0509;position:absolute;z-index:100;border:#00CCFF 1px solid;
width:100px;
height:120px;
display:none;
}
</style>
</head>
<body>
<div class='man'>
<div id="a">A</div>
<div id="b" >B</div>
<div id="c">C</div>
</div>
<script type="text/javascript">
var big = {};
big.hidenBig = function ()
{
_this.bigDiv.style.display = 'none';
}
big.big = function (o){
_this=this;
_this.bigDiv = document.createElement("div");
_this.bigDiv.setAttribute('class',o.className);
_this.bigDiv.setAttribute('className', o.className);
document.body.appendChild(_this.bigDiv);
document.getElementById(o.id).onmouseover = function ()
{
_this.bigDiv.style.top = this.offsetTop;
_this.bigDiv.style.left = this.offsetLeft;
_this.bigDiv.style.width = this.offsetWidth*1.3;
_this.bigDiv.style.height = this.offsetHeight*1.3;
_this.bigDiv.innerHTML = this.innerHTML;
_this.bigDiv.style.display = 'block';
}
_this.bigDiv.onmouseout = _this.hidenBig;
}
big.big({className:'biger',id:'a'});
big.big({className:'biger',id:'b'});
</script>
</body>
</html>
css和js学习之作
最新推荐文章于 2023-07-24 18:13:53 发布