window 重绘的 jQuery 事件是什么?
What is jQuery event on window redraw?
我在这个 sample code 中找到 jQuery 事件 redraw
:
$(window).on("redraw",function(){ [SOME CODE] });
我在 jQuery 站点、任何 JS 教程或参考资料中都没有找到任何文档 about it。
这是什么?
一定是插件在代码中某处触发的自定义事件。
这是可以在 jQuery
中创建的自定义事件的示例
演示:http://jsfiddle.net/Lk79jovg/
$('.test').on('keyup', function(){
var $this = $(this);
if($this.val() == 'some text'){
$(window).trigger('custom');
}
});
$(window).on('custom', function(){
alert('some text was typed in the input');
});
我在这个 sample code 中找到 jQuery 事件 redraw
:
$(window).on("redraw",function(){ [SOME CODE] });
我在 jQuery 站点、任何 JS 教程或参考资料中都没有找到任何文档 about it。
这是什么?
一定是插件在代码中某处触发的自定义事件。
这是可以在 jQuery
中创建的自定义事件的示例演示:http://jsfiddle.net/Lk79jovg/
$('.test').on('keyup', function(){
var $this = $(this);
if($this.val() == 'some text'){
$(window).trigger('custom');
}
});
$(window).on('custom', function(){
alert('some text was typed in the input');
});