0

我有多个 div 元素,我想在悬停时添加一个功能,但现在显示在所有 div 元素上。

如何在鼠标悬停时仅设置一个元素。预先感谢您的帮助

$('.box .line').hide();
// toggles the slickbox on clicking the noted link  
$('.box > div').hover(function() {
$('.box .line').toggle('fast');
return false;

});

安德鲁

4

1 回答 1

0
$('.box > div').hover(function() {
    $(this).find('.line').toggle('fast');
});
于 2012-09-17T15:37:36.163 回答