小白教程
所有教程
关于
Search
172.71.254.238
172.71.254.238
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Prop jquery fx off”的源代码
本页内容
上一节:
Prop_jquery_fx_interval
下一节:
Prop_jquery_support
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:jQuery.fx.off}}[[Category:jquery ref prop|4]] = jQuery jQuery.fx.off 属性 = [[jquery ref prop|jQuery 属性]] 切换动画开关: <sample title="" desc="" lang="html" hererun="1"> $("#disable").click(function(){ jQuery.fx.off = true; }); $("#enable").click(function(){ jQuery.fx.off = false; }); $("#toggle").click(function(){ $("div").toggle("slow"); }); </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#disable").click(function(){ jQuery.fx.off = true; }); $("#enable").click(function(){ jQuery.fx.off = false; }); $("#toggle").click(function(){ $("div").toggle("slow"); }); }); </script> </head> <body> <p>当“切换动画”开关按钮被按下时,我们伴着缓慢的动画在隐藏和显示div之间切换。按“启用”或“禁用”来打开和关闭动画。</p> <button id="disable">jQuery.fx.off = true ( 禁用 )</button> <button id="enable">jQuery.fx.off = false ( 启用 )</button> <br><br> <button id="toggle">切换动画</button> <div style="background:#98bf21;height:100px;width:100px;margin:50px;"> </div> </body> </html> </run> == 定义和用法 == jQuery.fx.off 属性用于对所有动画进行全局禁用或启用。 默认值是 false,它允许动画正常运行。当设置为 true 时,将禁用所有动画方法,这样会把元素设置为其最后的状态,而不是显示效果。 '''提示:'''如需简化代码,可以使用 $.fx.off 来代替 jQuery.fx.off。 == 语法 == <pre> jQuery.fx.off = true|false;</pre> {| class="table table-striped table-hover" ! 参数 ! 描述 |- | true | 规定应该禁用动画。 |- | false | 默认。规定应该启用动画。 |} [[jquery ref prop|jQuery 属性]]
返回至“
Prop jquery fx off
”。
上一节:
Prop_jquery_fx_interval
下一节:
Prop_jquery_support