2014-10-31 61 views
0

我有這個問題時,頁面加載mouseover是自動的作品當頁面加載鼠標懸停是自動工作

這裏是cssjavascript

$('.divTop').mouseover(function(){ 
     $('.private').stop().animate({"top":"0px"},200); 
     $('.corporate').stop().animate({"bottom":"0px"},200); 
    }); 
    $('.private, .corporate').mouseout(function(){ 
     $('.private').stop().animate({top:"-50%"},200); 
     $('.corporate').stop().animate({bottom:"-50%"},200); 
    }); 
.private{ 
    background-image:url('/CapitalBank/img/icon/umbrella.png'); 
    /* border-bottom:1px solid #d2ab67; */ 
    background-size:50px; 
    top:-50%; 
} 
.corporate{ 
    border-top:1px solid #d2ab67; 
    background-image:url('/CapitalBank/img/icon/key.png'); 
    bottom:-50%; 
} 
.divTop{ 
    position:relative; 
    float:left; 
    width:500px; 
    height:250px; 
    /* outline:1px solid white; */ 
    background-image: url('/CapitalBank/img/bg/ibank.png'); 
    background-position:center; 
    background-size:100% 100%; 
} 
+0

什麼是你的問題? – 3y3skill3r 2014-10-31 09:24:17

+0

mouseover自動工作 – 2014-10-31 09:25:46

+0

你想禁用此功能或綁定此功能的某些事件,或什麼? – 3y3skill3r 2014-10-31 09:26:32

回答

2
$('.divTop').mouseenter(function(){ 
    $('.private').stop().animate({"top":"0px"},200); 
    $('.corporate').stop().animate({"bottom":"0px"},200); 
}); 
$('.private, .corporate').mouseleave(function(){ 
    $('.private').stop().animate({top:"-50%"},200); 
    $('.corporate').stop().animate({bottom:"-50%"},200); 
});