jQuery Callback 方法
jQuery 教程
· 2019-03-09 10:42:25
Callback 函数在当前动画 100% 完成之后执行。
jQuery 动画的问题
许多 jQuery 函数涉及动画。这些函数也许会将 speed 或 duration 作为可选参数。
例子:$("p").hide("slow")
speed 或 duration 参数可以设置许多不同的值,比如 "slow", "fast", "normal" 或毫秒。
实例
以下实例在隐藏效果完全实现后回调函数:
使用 callback 实例
$("button").click(function(){
$("p").hide("slow",function(){
alert("段落现在被隐藏了");
});
});
以下实例没有回调函数,警告框会在隐藏效果完成前弹出:
没有 callback(回调)
$("button").click(function(){
$("p").hide(1000);
alert("段落现在被隐藏了");
});
点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html
Web Design DeMYSTiFieD
Willard, Wendy / 2010-11 / $ 24.86
Website Design just got a whole lot easier! This title helps you to learn the latest website development tools, techniques, and best practices. "Web Design Demystified" provides the hands-on help you ......一起来看看 《Web Design DeMYSTiFieD》 这本书的介绍吧!
JS 压缩/解压工具
在线压缩/解压 JS 代码
JSON 在线解析
在线 JSON 格式化工具