jQuery 事件方法

jQuery.holdReady()方法

阅读(382)

定义和用法 $.holdReady() 函数用于暂停或恢复.ready() 事件的执行。 注意:1. 该方法必须在文档靠前部分被调用,例如,在头部加载完 jQuery 脚本之后,立刻调用该方法。如果在 ready 事件已经被调用后再调用该方...

jQuery contextmenu() 方法

阅读(369)

定义和用法 contextmenu() 函数用于添加事件处理程序到 contextmenu 事件。 注意:.contextmenu() 方法只是作为 .on( "contextmenu", handler ) 的一个速记写法,移除该事件可以...

jQuery unload() 方法

阅读(356)

实例 Run this code » 当离开页面时,显示提示消息: $(window).unload(function(){     alert("Goodbye!"); }); 定义和用法 unload() 方法在 jQuery 版本 1...

jQuery undelegate() 方法

阅读(326)

实例 Run this code » 通过 undelegate() 方法从所有元素移除所有事件处理程序: $("body").undelegate(); 定义和用法 undelegate() 方法移除一个或多个由 delegate() 方...

jQuery unbind() 方法

阅读(358)

实例 Run this code » 移除所有 <p> 元素的事件处理程序: $("button").click(function(){ $("p").unbind(); }); 定义和用法 unbind() 方法移除被选元素的...

jQuery triggerHandler() 方法

阅读(336)

实例 Run this code » 触发 <input> 元素的 select 事件: $("button").click(function(){ $("input").triggerHandler("select"); })...

jQuery trigger() 方法

阅读(371)

实例 Run this code » 触发 <input> 元素的 select 事件: $("button").click(function(){ $("input").trigger("select"); }); 定义和用法...

jQuery toggle() 方法

阅读(419)

实例 Run this code » 当点击 <p> 元素时进行颜色切换: $("p").toggle( function(){$("p").css({"color":"red"});}, function(){$("p").c...

jQuery submit() 方法

阅读(344)

实例 Run this code » 当提交表单时,显示警告框: $("form").submit(function(){    alert("提交"); }); 定义和用法 当提交表单时,会发生 submit 事件。 该事件只适用于 元素...

jQuery select() 方法

阅读(334)

实例 Run this code » 当文本域中的文本被选择时,显示提示消息: $("input").select(function(){    alert("文本已选中!"); }); 定义和用法 当 textarea 或文本类型的 in...