大家好,我正在尝试创建一个可以为 div 设置动画的脚本问题是我想在许多 div 上使用此脚本并为选定的 div 设置动画
这是jquery脚本
$(document).ready(function(){
$('.window_content').mouseleave(function() {
$('.theme_window').animate({'right': '+=297px'},'fast');
});
$('.theme_window').mouseover(function() {
$('.theme_window').animate({'right': '-=297px'},'fast');
});
});
</script>
这是div
<div class="window">
<div class="window_content">
Content
</div>
<div class="theme_window">
Sport
</div>
</div>
<div class="window">
<div class="window_content">
Content
</div>
<div class="theme_window" style="background-color:#1372BF">
Music
</div>
</div>
我只显示了 2 个带有 class="window" 的 div,但会有很多 div
我知道我的脚本没有我想要的那么好,当我选择一个 div 时,所有其他 div 都是动画的。