<html>
<head>
<title>点击按钮移动的div(1.1作品)</title>
</head><BODY>
<input type="button" value="↑" οnclick="up()">
<input type="button" value="←" οnclick="left()">
<input type="button" value="↓" οnclick="down()">
<input type="button" value="→" οnclick="right()">
<div id="a" nowrap style="position:absolute; left:5; top:50; width:100; height:40; z-index:1; overflow: auto; overflow:hidden">
壹点壹作品
</div>
<script>
var distance=50;
function left(){
a.style.left= (parseInt(a.style.left) - distance) + "px";
}
function right(){
a.style.left= (parseInt(a.style.left) + distance) + "px";
}
function up(){
a.style.top = (parseInt(a.style.top) - distance) + "px";
}
function down(){
a.style.top = (parseInt(a.style.top) + distance) + "px";
}
</script> </body></html>
点击按钮移动的div
最新推荐文章于 2024-09-04 15:47:59 发布