查看“Js停止动画”的源代码
←
Js停止动画
跳转至:
导航
,
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>停止动画</title> <link rel="stylesheet" href=""> <style> .box{ width:400px; height:400px; background:red; margin-top:20px; } button{ font-size:30px; } </style> <script src="js/jquery.min.js"></script> <script> $(function(){ $(".box").animate({ "width":"+=400px" }, 2000) $(".box").animate({ "height":"+=200px" }, 2000) $(".box").animate({ "opacity":"0.2" }, 2000) $(".btn").click(function(){ $(".box").stop();//停止当前动画,后续继续执行 }); $(".btn1").click(function(){ $(".box").stop(true);//停止当前动画及后续动画 }) $(".btn2").click(function(){ $(".box").stop(true,true);//停止当前执行的动画并且跳转到当前动画的最终状态,后续不执行 }) }) </script> </head> <body> <button class="btn">stop()</button> <button class="btn1">stop(true)</button> <button class="btn2">stop(true,true)</button> <div class="box"></div> </body> </html>
返回至
Js停止动画
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息