打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
鼠标触发图片震动效果代码:

鼠标触发图片震动效果代码:

<style>
.shakeimage{
position:relative
}
</style>
<script language="JavaScript1.2">
/*
Shake image script (onMouseover)-
Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://www.qpsh.com
*/
//configure shake degree (where larger # equals greater shake)
var rector=3
///////DONE EDITTING///////////
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 bgcolor="#F7F7F7">
<p align="center">
<img src=http://www.qpsh.com/images/logo.jpg class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this)">
<br>
鼠标移动上来看效果!</p>
本代码由<a href=/myuserhome.aspx?isowner=1>【荷花小女子】</a>提供
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
360图书馆的顶图
JavaScript页面内拖拽原理分析
鼠标特效代码后缀汇集[中]
多种可爱鼠标指针代码(图)
javascript 拖拽
“你手机在震”英语怎么说?可不能说your phone is shaking!
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服