<body onload="ready=true;">
<div id="d1" style="position:absolute;top:10px;left:10px;"><img id="t1" src="
http://www.51js.com/images/51js/51js.gif"></div>
<br><br><br><br>
比例:<select onChange="t2.width=t1.width*value;t2.height=t1.height*value;s=value;">
<option value="1">1</option>
<option value="2">2</option>
<option value="4">4</option>
</select>
<div id="d2" style="position:absolute;top:80px;left:100px;width:100px;height:100px;border:1 black solid;overflow:hidden;"><img id="t2" style="position:absolute;" src="
http://www.51js.com/images/51js/51js.gif"></div>
<script language="JavaScript">
var ready = false;
var s=1;
document.onmousemove = function(){
if(ready){
t2.style.left = (-window.event.clientX+parseInt(d1.style.left)+2)*s+parseInt(d2.style.width)/2;
t2.style.top = (-window.event.clientY+parseInt(d1.style.top)+2)*s+parseInt(d2.style.height)/2;
}
}
</script>
posted on 2006-04-03 15:36
汪杰 阅读(709)
评论(0) 编辑 收藏 引用 所属分类:
hengxing网站js