您的位置:首页 > Web前端 > JQuery

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);
})





                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: