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