类似QQ窗口的抖动效果(转)
2011-03-08 15:02
369 查看
<!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=gbk" /> <style type="text/css"> #body{text-align:center;} #test{width:119px;position:absolute;margin:10px auto;height:114px;background:url(http://www.blueidea.com/articleimg/2008/05/5766/01.jpg) ;border:2px dotted red;} </style> <script type="text/javascript"></script> </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> <script type="text/javascript"> var m=document.getElementById("test"); function SKclass(obj,Rate,speed) { var oL=obj.offsetLeft; var oT=obj.offsetTop; this.stop=null; this.oTime=null; this.state=0; var om=this; this.start=function(){ if(this.state==0){ ostart(); this.state=1; }else{ alert("这样你受得了吗?"); } } var ostart=function(){ if(parseInt(obj.style.left)==oL-2){ obj.style.top=oT+2+"px"; setTimeout(function(){obj.style.left=oL+2+"px"},Rate) } else{ obj.style.top=oT-2+"px"; setTimeout(function(){obj.style.left=oL-2+"px"},Rate) } om.oTime=setTimeout(function(){ostart()},speed); } this.stop=function(){ clearTimeout(om.oTime); this.state=0; } } var nn=new SKclass(m,20,50); </script>
相关文章推荐
- 类似QQ窗口的抖动效果
- 类似QQ的窗口抖动效果
- JS层抖动特效,类似QQ聊天窗口抖动
- Android仿QQ窗口的抖动的动画效果
- Qt 高仿QQ窗口抖动效果【原】
- Android仿QQ窗口的抖动的动画效果
- android中类似 QQ震动窗口的实现,带声音和振动效果
- JS层抖动特效,类似QQ聊天窗口抖动
- js模拟QQ窗口的抖动效果
- JavaScript qq窗口抖动效果
- js模拟QQ窗口的抖动效果
- 网页用 JavaScript DOM 仿作QQ的窗口抖动效果,超简单~~~
- 网页用 JavaScript DOM 仿作QQ的窗口抖动效果,超简单~~~
- 模拟QQ窗口抖动效果
- Android仿QQ窗口的抖动的动画效果
- 教你作类似msn(QQ)等网页中窗口的拖动效果
- 像MSN,QQ,迅雷类似效果的提示窗口
- .NET Winform也能画出类似QQ、飞信这样的窗口风格和控件效果
- 模拟QQ窗口抖动效果(通过MoveWindow和Sleep进行模拟)
- Android实现类似QQ的滑动删除效果