做一个控件时碰到的一些无法同步处理的事件,可以用这样的延迟方法。
<html> <script src="js/jquery.js"></script> <script> $(function(){ $('#test').bind("click",function(){ setTimeout(function(){alert($('#test').val());},800); }); $('#test').bind("blur",function(){ $('#test').val("已经赋值啦!"); }); }) </script> <input type="text" id="test" size="12" value=""> </html>
相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
推荐阅读:
以上就是怎样使jQuery延迟执行的详细内容,更多请关注php中文网其它相关文章!