This works ( .hover ):
$('a.directory:not(.trashContent), a.file:not(.trashContent)').hover(function() {
if (!dragged) $(this).find('a.suppr:first').show();
}, function() {
$(this).find('a.suppr:first').hide();
});
And this does not work ( .live('hover') ):
$('a.directory:not(.trashContent), a.file:not(.trashContent)').live('hover', function() {
if (!dragged) $(this).find('a.suppr:first').show();
}, function() {
$(this).find('a.suppr:first').hide();
});
Any idea why?
The reason why it doesn’t work is, that hover is not really a single event. It binds together the event handlers for mouseenter and mouseleave.
Means hover itself is not really an own event handler. To make it work with live (better use .on() ) you must use the event handlers seperated.