此作品(.hover
):jQuery的:問題與.live()
$('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();
});
而且這不起作用(.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();
});
任何想法,爲什麼?
''hover''不是事件類型。 'hover()'是一個由jQuery定義的自定義速記方法。 –
fyi,'live'被認爲在jquery的新版本中被棄用。 –
您是否試過mouseout和mouseover事件? –