<!--完整的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>