60、实例 使用jQuery实现自定义动画效果
2014-07-10 16:40
911 查看
<!doctype html> <html> <head> <meta charset="utf-8"> <title>使用jQuery实现自定义动画效果</title> <script type="text/javascript" src="jquery-2.1.0.js"></script> <script> //可以给一个对象添加多个动画效果,可以放到队列当中去(默认就是),有两种方法可以不回,一个是链接语法,一个单独的添加. $(document).ready(function(e) { $(".toright").click(function(event) { $("div").animate( { left:"+=100px" },1500); }); $(".toleft").click(function(event) { $("div").animate( { left:"-100px" },1500); }); $(".stopanimate").click(function(event) { $("div").stop(true,false,true); }); $(".closeanimate").click(function(event) { $.fx.off=true; }); $(".openanimate").click(function(event) { $.fx.off=false; }); }); </script> </head> <body> <button class="toleft">向左定位到-100px</button> <button class="toright">向右移动+=100px</button> <button class="stopanimate">停止动画运行</button> <button class="closeanimate">关闭动画效果</button> <button class="openanimate">打开动画效果</button> <br/> <div style="position:absolute;border:solid 1px red;left:200px"> 自定义动画 </div> </body> </html>
相关文章推荐
- jQuery动画效果animate和scrollTop结合使用实例
- 使用jQuery实现的掷色子游戏动画效果
- jQuery实现动画效果circle实例
- jQuery实现动画效果circle实例
- jQuery模拟实现天猫购物车动画效果实例代码
- jQuery实现动画效果的简单实例
- jQuery实现带有洗牌效果的动画分页实例
- 通过jquery实现页面的动画效果(实例代码)
- jQuery实现连续动画效果实例分析
- JQuery实现DIV其他动画效果的简单实例
- 使用ListView控件实现漂亮的自定义表格效果实例
- 使用ListView控件实现漂亮的自定义表格效果实例
- jQuery动画效果animate和scrollTop结合使用实例
- 60.自定义View练习(五)高仿小米时钟 - 使用Camera和Matrix实现3D效果
- Flex4之自定义动画效果,使用自定义Parallel类来实现
- jQuery动画效果animate和scrollTop结合使用实例
- jQuery实现感应鼠标动画效果自动伸长的输入框实例
- jQuery动画效果animate和scrollTop结合使用实例
- JQuery实现DIV其他动画效果的简单实例
- jQuery实现连续动画效果实例分析