html元素摇摆

<script type="text/javascript" src="jquery-1.9.0.min.js"></script> <script type="text/javascript"> jQuery.fn.shake = function(intShakes /\*Amount of shakes\*/, intDistance /\*Shake distance\*/, intDuration /\*Time duration\*/) {     this.each(function() {         var jqNode = $(this);         jqNode.css({position: 'relative'});         for (var x=1; x<=intShakes; x++) {             jqNode.animate({ left: (intDistance \* -1) },(((intDuration / intShakes) / 4))).animate({ left: intDistance },((intDuration/intShakes)/2)).animate({ left: 0 },(((intDuration/intShakes)/4)));         }     });     return this; } $(function() {   $('#div1').click(function() {     $(this).shake(5,10,400);   }); }); </script> <body> <div id="div1" style="width:20px;height:20px;background:red;"></div> </body>
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

JS导出页面为PDF文件,该如何操作?来看一眼就明白啦!

废话不多说,直接上代码。1.资源文件或依赖<scripttype"text/javascript"src"https://my.oschina.net//u/4265132/blog/4054317/js/canvg2.js"</script<scripttype"text/javascript"src"https://m

Html5添加三联切换仿3D效果旋转木马jQuery插件教程

一、使用方法<script type"text/javascript" src"js/jquery.min.js"</script<script type"text/javascript" src"js/gallery.js"</script   二、Html结构<div id"wrapper"<div id"mai