jquery width,innerWidth,outterWidth 及事件操作
2016-05-19 17:13
671 查看
* width() * innerWidth() //width+padding * outterWidth() //width+padding+border * outterWidth(true) //width+padding+border+margin
* on() * off(); $("div").on("click mouseover",function(){ alert("我被触发了"); }) $("div").on({ 'click' : function(){ alert("event1"); }, 'mouseover' : function(){ alert("event2"); } }) $("div").on('click',function(){ alert("123"); $("div").off(); $("div").off('mouseover'); })
* ev.pageX(相对于文档) clientX(相对于可视区 * ) * ev.which keyCode * * ev.preventDefault() 阻止默认事件 * ev.stopPropagation() 阻止事件冒泡 * return false 阻止默认事件又阻止冒泡事件 * one() //事件只执行一次 * each()
$("div").one("click",function(){ alert("123"); })
$("li").each(function(i,element){ // i:下标 $(element).html(i); })
相关文章推荐
- jQuery.html() .text()和.val() 的用法
- Jquery可移动的DIV
- JQuery为textarea添加maxlength属性并且兼容IE
- 用jQuery获取table中行id和td值的实现代码
- jQuery scrollFix滚动定位插件
- SpringMVC和jQuery的Ajax简单文件上传下载示例
- jquery遍历table的tr获取td的值实现方法
- jquery if条件语句的写法
- jquery 弹窗插件 layer
- jquery.base64.js简单使用
- jquery的ajax同步和异步
- 设置 datetimepicker 只选择日期 不选择时分秒
- jQuery 自定义事件
- jquery复选框操作
- 原生JS事件绑定方法以及jQuery绑定事件方法bind、live、on、delegate的区别
- 浅析jquery数组删除指定元素的方法:grep()
- jQuery实现二级菜单显示(超链接中)
- 基于jQuery的Web上传插件Uploadify使用示例
- 【JQ】jquery如何判断一个节点下面没有子节点方法整理
- Jquery-animateNumber数字动画插件