업데이트 : 코드를 통합하고 if/else 문을 추가하려고했습니다. 난 아직도 클릭에 얻는 방법 mouseenter /하는 MouseLeave 기능jquery .hover 다음 .click을 클릭하면 문제가 생깁니다.
$('#storybtn').on({
mouseenter:function(){
$('#story')
.stop()
.animate({top:'405px'},'slow');
},
mouseleave:function(){
$('#story')
.stop()
.animate({top:'435px'},'slow');
},
click:function(){
var position = $('#story').css('top');
if (position>'10px'){
$('#story')
.stop()
.animate({top:'10px'},'slow');
}
else (position='10px'){
$('#story')
.stop()
.animate({top:'435px'},'slow');
}
}
});
.on이 더 잘 작동하지만 클릭하고 마우스를 놓고 div 비행기를 깨면 자동으로 롤백됩니다. –