读书人

Jquery亟需注意的事件操作

发布时间: 2013-01-26 13:47:02 作者: rapoo

Jquery需要注意的事件操作
//单击选中行
$("table.list tr").click(function(){
$("table.list tr").each(function (){
if $(this).hasClass("select")){
$(this).removeClass("select");
}
});
$(this).toggleClass("select");
selCarId=$("td[abbr=deviceId]",$(this)).text();
carNumber=$("td[abbr=carNumber]",$(this)).text();
$("input",".toolbar").each(function(){
$(this).removeAttr("disabled");
});
});
$("table.list tr").bind("click",function(){ });

//注册双击事件,打开车辆信息窗口
$("table.list tr").dblclick(function(){
openCarPopup(carNumber);
});

$("table.list tr").bind("dblclick",function(){
openCarPopup(carNumber);
});

注意:这里的双击事件是"dblclick"而不是dbclick。
所以,如果你马虎的记得是dbclick那么事件就不起作用了。

读书人网 >Web前端

热点推荐