开发者

Using live method with Hover event

How can i use live method with h开发者_C百科over event? it's possible to do? or i'll need to use live method on mouseover and mouseout events.


hover() is a shortcut to mouseenter and mouseleave events.

Just bind it with...

$('a')
 .live('mouseenter', function() { ... })
 .live('mouseleave', function() { ... });


Jquery's hover is a shortcut/shim for ies mouseenter and mouseleave events.

Bind simply using the live like Any other event.

$('selector')
.live('mouseenter',fun..)
.live('mouseleave',fun....);

But their will be a performance overhead, so it typically isn't encouraged. You should really use delegate for a speed increase.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜