您当前所在的位置:首页>>设计教程>>网页设计>>正文 文章正文
如何给片抖动怎做的
作者: 佚名 点击数:

〈SCRIPT language=javascript1.2〉
〈!--
var rector=2
var stopit=0
var a=1
var count=0
function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}
function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1||count==100)
return
count++
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
count=0
which.style.left=0
which.style.top=0
}
//--〉
〈/SCRIPT〉
〈style〉.shakeimage {POSITION: relative}
〈/style〉
〈img src="图片的路径" onmouseout=stoprattle(this) onmouseover=init(this);rattleimage() class=shakeimage〉

相 关 搜 索
今 日 头 条
 
最 新 热 门
最 新 推 荐
 
文章来源: 网络  更新时间:2004-5-23 13:46:53  责任编辑:stsee
  上一篇文章:怎么改变滚动条的颜色,只有ie5.5版本以上才能支持。
下一篇文章:在DW如何给水平线加颜色
相关文章
在DW如何给水平线加颜色
如何在网页中实现flash的全屏播放
如何改变鼠标的形状
网页弹出窗口的制作
用marquee做的滚动字幕
怎样在IE中调用Dreamweaver进行编
如何让一张片有浅到深的渐变
双击鼠标左键来滚动背景,单击停
如何在同一页面设置不同文字链接
用CSS给文字加入阴影效果和文字描