`
- 浏览:
55687 次
- 性别:
- 来自:
北京
-
今天了解了jQuery中几个自定义的事件:
(1)hover(fn1,fn2):一个模仿悬停事件的方法。
//当鼠标放在表格的某行上时将class置为over,离开时置为out。
$("tr").hover(function(){
function(){
$(this).addClass("out");
});
(2)ready(fn):当DOM载入就绪可以查询及操纵时绑定一个要执行的函数。
$(document).ready(function(){alert("Load Success")})
//页面加载完毕提示“Load Success”,不同于onload事件,onload需要页面内容加载完毕(图片等),而ready只要页面html代码下载完毕即触发。与$(fn)等价。
(3)toggle(evenFn,oddFn): 每次点击时切换要调用的函数。
//每次点击时轮换添加和删除名为selected的class。
$("p").toggle(function(){
$(this).addClass("selected");
},function(){
$(this).removeClass("selected");
});
(4)trigger(eventtype): 在每一个匹配的元素上触发某类事件。
eg:
//触发所有p元素的click事件
$("p").trigger("click");
(5)bind(eventtype,fn),unbind(eventtype): 事件的绑定与反绑定
从每一个匹配的元素中(添加)删除绑定的事件。
eg:
//为每个p元素添加单击事件
$("p").bind("click", function(){alert($(this).text());});
//删除所有p元素上的所有事件
$("p").unbind();
//删除所有p元素上的单击事件
$("p").unbind("click")
(6)animate用于创建自定义动画的函数。
这个函数的关键在于指定动画形式及结果样式属性对象。
每个属性的值表示这个样式属性到多少时动画结束。
eg:
$("a",this).animate({ height: "0px",top: "25px"}, 80);
$("a",this).animate({ height: "28px",top: "10px"}, 80);
(7)fadeIn(speed,[callback])通过不透明度的变化来实现所有匹配元素的淡入效果并在 动画完成后可选地触发一个回调函数。
eg:
$("p").fadeIn("fast",function(){
alert("Animation Done.");
});
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
jquery插件jquery-ui-1.8.18.custom.min.js
${ctx}/plugins/jquery-ui-1.11.2/jquery-ui.css" > ${ctx}/plugins/jquery-ui-1.11.2/external/jquery/jquery.js"> ${ctx}/plugins/jquery-ui-1.11.2/jquery-ui.js"> ${ctx}/plugins/jquery-ui-1.11.2/jquery-ui-...
jquery-ui-日期框扩展成时间框 jquery-ui时间框 基于别人的代码进行修改 jquery-ui-1.8.16.custom.css文件末尾加入以下代码 .ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; } .ui-timepicker-div dl{ ...
jquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-uijquery-ui
jquery-ui-1.8.2.custom.min.js,jquery-ui-1.8.4.custom.css
<script src="./public/js/jquery-ui-1.10.3.min.js"> <script src="./public/js/jquery.datepicker-zh-CN.js"></script> <link href="./public/css/jqueryui/jquery-ui-1.10.3.min.css" rel="stylesheet"> $( "#...
这里包含jquery-ui-1.8.16.custom.min.js/jquery-ui-1.8.16.custom.css,我费了好长时间找到的,此东西可以配合jQuery UI开发指南一书使用。
jquery插件jquery-ui-1.8.2.custom.min.js
jquery-easyui-EDT-1.5.2-build1 jquery-easyui-EDT-1.5.2-build1
jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-ui-1.8.16jquery-...
jquery-ui-1.8.18.custom
1、将jquery-1.6.4-vsdoc.js与jquery-1.6.4.js放在同一目录,然后在vs中添加对jquery-1.6.4.js的引用即可; 2、切记:两个文件的文件名不能修改,并且只要引用jquery-1.6.4.js而不要引用jquery-1.6.4-vsdoc.js。
jquery-ui-1.7.3.custom JQUERY UI
jQuery版本迁移辅助插件,如果您使用的低版本jQuery改为高版本后出现错误,可以试试这个插件。用来检测和恢复在jQuery1.9版本中已删除或已过时的API。jquery-migrate-1.2.1.js,jquery-migrate-1.2.1.min.js
jquery.mobile-1.4.5 jquery.mobile-1.4.5 jquery.mobile-1.4.5
jquery-ui-1.7.3.custom 完整开发包
jquery-1.4.2-vsdoc.js jquery-1.4.4-vsdoc.js
jquery-ui-1.9.2.custom.min.js
struts2-jquery-plugin-3.1.0.jar
jquery-ui-1.10.3.js 版本 1积分下载 jquery-ui-1.10.3.js 版本 1积分下载 jquery-ui-1.10.3.js 版本 1积分下载