有什么问题请到<a href='/bbs/forums.php?fid=21'>论坛</a>中发表<br>
<!-- http://www.webjx.com/ -->
<!-- http://bbs.webjx.com/ -->
<!--完整的HTML代码如下:-->
<html>
<head>
<script language="JavaScript">
<!--
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
function init() {
if (ns4) block = document.blockDiv
if (ie4) block = blockDiv.style
block.xpos = parseInt(block.left)
block.active = false
}
function slide() {
if (block.active) {
block.xpos += 5
block.left = block.xpos
setTimeout("slide()",30)
}
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" onLoad="init()">
<p>点击或按着不动以下链接使对象移动。</p>
<p><a href="javascript:void(null)" onMouseDown="block.active=true; slide(); return false;" onMouseUp="block.active=false" onMouseOut="block.active=false">移动</a>
</p>
<div id="blockDiv" style="position:absolute; left:50px; top:100px; width:30px; height:30px; clip:rect(0px 30px 30px 0px); layer-background-color:red; background-color:red;">
</div>
</body>
</html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]