Javascript函数加载叠加问题
发布网友
发布时间:2022-04-25 03:04
我来回答
共1个回答
热心网友
时间:2022-04-25 04:33
<!DOCTYPE HTML>
<html>
<head>
<title>yugi</title>
<meta charset=UTF-8 />
<style type="text/css">
#little {
width: 400px;
height: 300px;
float: left;
}
#Big_wrap {
width: 400px;
height: 300px;
float: left;
overflow: hidden;
display: none;
}
#Big {
width: 800px;
height: 600px;
float: left;
position: relative;
top: 0;
left: 0;
}
</style>
<script type="text/javascript">
var x = 0;
var y = 0;
var h = y;
var w = x;
function move (e)
{
e = e || window.event;
x = e.clientX;
y = e.clientY;
h == -y ? h = -y : (h < -y ? h++ : h--);
Big.style.top = h + "px";
w == -x ? w = -x : (w < -x ? w++ : w--);
Big.style.left = w + "px";
}
function stop ()
{
document.getElementById ("Big_wrap").style.display = "none";
}
</script>
</head>
<body>
<div id="little" onmousemove="move()">
<img onmouseout="stop()" onmouseover="document.getElementById ('Big_wrap').style.display = 'block';" src="bar_bg.png">
</div>
<div id="Big_wrap">
<div id="Big">
<img src="cleanapp.png">
</div>
</div>
</body>
</html>