鼠标移至图片后抖动的JS代码
来源:广州中睿信息技术有限公司官网
发布时间:2012/10/21 23:25:16 编辑:admin 阅读 386
代码简介:仿QQ的窗口抖动特效,鼠标移到到图片上面,图片就开始疯狂的抖动,好像对你的鼠标过敏一样,比较有意思,有会你的网页增加了修改功能。代码内容:ViewCode<html><head

代码简介:

仿QQ的窗口抖动特效,鼠标移到到图片上面,图片就开始疯狂的抖动,好像对你的鼠标过敏一样,比较有意思,有会你的网页增加了修改功能。

代码内容:

View Code
<html>
<head>
<title>鼠标移至图片后抖动的JS代码 - www.webdm.cn</title>
</head>
<BODY>
<style>
.shakeimage
{
position
:relative
}
</style>
<img src=http://www.webdm.cn/images/wall1_s.jpg class="shakeimage" onMouseover="init(this);rattleimage()"

onMouseout
="stoprattle(this)">
<script language="JavaScript1.2">
var rector=3
var stopit=0
var a=1

function init(which){
stopit
=0
shake
=which
shake.style.left
=0
shake.style.top
=0
}

function rattleimage(){
if ((!document.all && !document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top
=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left
=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top
=parseInt(shake.style.top)-rector
}
else{
shake.style.left
=parseInt(shake.style.left)-rector
}
if (a<4)
a
++
else
a
=1
setTimeout(
"rattleimage()",50)
}

function stoprattle(which){
stopit
=1
which.style.left
=0
which.style.top
=0
}
</script>
</body>
</html>
<br />
<p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的网页代码下载网站 - 致力为中国站长提供有质量的网页代码!

</p>

 

代码来自http://www.webdm.cn/webcode/1c36fac4-9137-4d1e-ad8e-028e3fa8effb.html

联系我们CONTACT 扫一扫
愿景:成为最专业的软件研发服务领航者
中睿信息技术有限公司 广州•深圳 Tel:020-38931912 务实 Pragmatic
广州:广州市天河区翰景路1号金星大厦18层中睿信息 Fax:020-38931912 专业 Professional
深圳:深圳市福田区车公庙有色金属大厦509~510 Tel:0755-25855012 诚信 Integrity
所有权声明:PMI, PMP, Project Management Professional, PMI-ACP, PMI-PBA和PMBOK是项目管理协会(Project Management Institute, Inc.)的注册标志。
版权所有:广州中睿信息技术有限公司 粤ICP备13082838号-2