jquery元素事件

$().bind(元素事件,参数,方法),如没有参数方法做第二个参数

例子:有参数$("img").bind("click","hello",function (event){alert(event.date)})

无参数$("img").bind("click",function (event){alert("sdfasd")})

最好将方法写出来,这样更规范,也不容易出错

$().unbind(元素事件,方法名)删除方法,如多个方法空格隔开

$().元素事件.(方法)

例子:$("img").click(function(event){alert("asdf")})

event属性

 

 

posted @ 2012-09-14 21:42  树形图  阅读(207)  评论(0编辑  收藏  举报