资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
js模拟QQ窗口的抖动效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> #body{text-align:center;} #test{width:119px;position:absolute;margin:10px auto;height:114px;background:url(/images/logo.gif) ;border:2px dotted red;} </style> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%3C%2Fscript%3E"> </head> <body> <div style='margin:10px 200px'> <div><input type="button" value="~~~让我抖抖吧~~" onclick="nn.start()" /></div> <div><input type="button" value="别抖了眼睛晕的很" onclick="nn.stop()" /></div> <div id="test"></div> </div> </body> </html> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%20%0D%0A%20var%20m%3Ddocument.getElementById(%22test%22)%3B%20%0D%0Afunction%20SKclass%20(obj%2CRate%2Cspeed)%20%7B%20%0D%0A%20%20%20%20%20var%20oL%3Dobj.offsetLeft%3B%20%0D%0A%20%20%20%20%20var%20oT%3Dobj.offsetTop%3B%20%0D%0A%20%20%20%20%20this.stop%3Dnull%3B%20%0D%0A%20%20%20%20%20this.oTime%3Dnull%3B%20%0D%0A%20%20%20%20%20this.state%3D0%3B%20%0D%0A%20%20%20%20%20var%20om%3Dthis%3B%20%0D%0A%20%20%20%20%20this.start%3Dfunction()%7B%20%0D%0A%20%20%20%20%20%20%20%20if(this.state%3D%3D0)%7B%20%0D%0A%20%20%20%20%20%20%20%20%20ostart()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20this.state%3D1%3B%20%0D%0A%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20else%7Balert(%22%E8%BF%99%E6%A0%B7%E4%BD%A0%E5%8F%97%E5%BE%97%E4%BA%86%E5%90%97%EF%BC%9F%22)%7D%20%20%0D%0A%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20var%20ostart%3Dfunction()%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20if(parseInt(obj.style.left)%3D%3DoL-2)%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obj.style.top%3DoT%2B2%2B%22px%22%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20setTimeout(function()%7Bobj.style.left%3DoL%2B2%2B%22px%22%7D%2CRate)%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20else%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20obj.style.top%3DoT-2%2B%22px%22%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20setTimeout(function()%7Bobj.style.left%3DoL-2%2B%22px%22%7D%2CRate)%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20om.oTime%3DsetTimeout(function()%7Bostart()%7D%2Cspeed)%3B%20%0D%0A%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20this.stop%3Dfunction()%7B%20%0D%0A%20%20%20%20%20%20%20clearTimeout(om.oTime)%3B%20%0D%0A%20%20%20%20%20%20%20this.state%3D0%3B%20%0D%0A%20%20%20%20%20%20%0D%0A%20%20%20%20%20%7D%20%0D%0A%7D%20%0D%0Avar%20nn%3Dnew%20SKclass(m%2C20%2C50)%3B%20%0D%0A%3C%2Fscript%3E">
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程