css和js学习之作

<!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>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值