2012-09-13 44 views
2

我做了这个website,当您将鼠标悬停在顶部导航栏上的COLLECTION选项卡上或侧边栏上时,底部内容向下滑动,这正是我想要的。但我的问题是,当我徘徊它弹出备份这不是我想要的。虽然它不是我设置的切换功能,但它似乎像它一样工作。有人能帮助我吗?悬停功能触发器

$('.down').hover(function() { 
    $('.b2-a .has_scroll').stop().animate({ 
     height: "22px" 
    }, 500); 
    $('.b2-b .slide-div').stop().animate({ 
     height: "19px" 
    }, 500); 
    $("#slide-title h4").show(); 
    $(".slide-div").animate({ 
     marginTop: "-12px" 
    }); 
    $('.b2 .tancar').animate({ 
     backgroundPosition: '28px 4px' 
    }) 
}, function() { 
    $('.b2-a .has_scroll').stop().animate({ 
     height: "120px" 
    }, 500); 
    $('.b2-b .slide-div').stop().animate({ 
     height: "438px" 
    }, 500); 
    $("#slide-title h4").hide(); 
    $(".slide-div").animate({ 
     marginTop: "-12px" 
    }); 
    $('.b2 .tancar').animate({ 
     backgroundPosition: '28px -19px' 
    }) 
}); 

回答

0

我认为你需要重新考虑你的代码。它看起来像你已经在许多不同的事件滑动。你想让它在点击按钮和悬停时滑动吗?如果是这样,做这样的事情:

$('.b2').hover(function() { 
    // do animation to show 
)); 
$('#clic').click(function() { 
    // do animation to show 
)); 
$('.b2').mouseout(function() { 
    // do animation to hide 
)); 
+0

谢谢user1477388,我知道它的错误,我需要学习更多,更逻辑。非常感激! –

+0

不客气:) – user1477388