2012-09-13 6 views
0

마우스를 가져 가면 가리킨 다음 페이드 인하는 캡션이 있습니다. 캡션이 마우스 센터의 이미지 위에서 아래로 슬라이드 한 다음 다시 mouseleave에서 위로 움직일 수 있도록 어떻게 변경합니까?호버 위에서 이미지 캡션 슬라이드

<a href="link.html"> 
    <div class='wrapper'> 
     <img alt="" width="184" height="69" src="image.png" /> 
     <div class="description"> 
      <div class="description_content">Title<br /><small>Description text</small></div> 
     </div> 
    </div> 
</a> 

JQuery와

$(window).load(function(){ 
     $('div.description').each(function(){ 
     $(this).css('opacity', 0); 
     $(this).css('width', $(this).siblings('img').width()); 
     $(this).parent().css('width', $(this).siblings('img').width()); 
     $(this).css('display', 'block'); 
    }); 

$('div.wrapper').mouseenter(function(){  
    $(this).children('.description').stop().fadeTo(700, 1); 
}).mouseleave(function(){ 
    $(this).children('.description').stop().slideUp(700); 
}); 

}); 

답변

1

이 시도 :

$('div.wrapper').mouseenter(function(){  
    $(this).children('.description').stop().slideDown(700); 
}).mouseleave(function(){ 
    $(this).children('.description').stop().slideUp(700); 
}); 
+0

것도이 함께 발생하지 않습니다. 아무것도 나타나지 않습니다. – user1568736

+1

은이 [jsFiddle] (http://jsfiddle.net/z8jLh/1/)을 체크 아웃하면서'.stop()'을 꺼냅니다. – kingkode

관련 문제