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.
精彩评论