jQuery 的 live() 方法对 hover 事件的处理

要求 jQuery 1.4.3+

因为hover不是标准的事件,因此无法直接使用live进行处理,故使用以下方法代替,效果一样。

mouseenter:当鼠标指针进入(穿过)元素时
mouseleave:当鼠标指针离开元素时

$("table tr").live({
   mouseenter:
   function()
   {
      //todo
   },
   mouseleave:
   function()
   {
      //todo
   }
});

发表评论

邮箱地址不会被公开。 必填项已用*标注