我在一些帮助下制作了一些样式,以便在鼠标结束时移动文本。我的问题是我无法分开 Action 。如果我超过任何一个盒子,那么所有盒子都会产生效果。
$(document).ready(function(){
$('.up-down').mouseover(function(){
$('.default').stop().animate({
height: 200
}, 200);
}).mouseout(function(){
$('.default').stop().animate({
height: 240
}, 200)
})
});
最佳答案
您必须选择当前悬停元素的子元素:
$(document).ready(function(){
$('.up-down').mouseover(function(){
$(this).children('.default').stop().animate({
height: 200
}, 200);
}).mouseout(function(){
$(this).children('.default').stop().animate({
height: 240
}, 200)
})
});
关于javascript - jQuery Slide 悬停单独移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14524733/