代码示例:(标识:dhtm_link_shake)
<html>
<head>
<script type="text/javascript">
function shakeleft()
{
document.getElementById('myLink').style.position="relative"
document.getElementById('myLink').style.left="3"
timer=setTimeout("shakeright()",10)
}
function shakeright()
{
document.getElementById('myLink').style.left="0"
timer=setTimeout("shakeleft()",10)
}
function stoptimer()
{
clearTimeout(timer)
}
</script>
</head>

<body>
<a id="myLink" href="http://www.sou-xun.com/"
onmouseover="shakeleft()" onmouseout="stoptimer()">请把鼠标移动到链接上</a>
</body>

</html>
运行结果: