jquery width,innerWidth,outterWidth 及事件操作

来源:互联网 发布:wince6.0导航软件 编辑:程序博客网 时间:2024/06/05 23:57
 * 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.whichkeyCode * * ev.preventDefault()阻止默认事件 * ev.stopPropagation()阻止事件冒泡 * return false 阻止默认事件又阻止冒泡事件  * one()//事件只执行一次 * each()
$("div").one("click",function(){alert("123");})
$("li").each(function(i,element){// i:下标       $(element).html(i);})
                                             
0 0