채택완료
jQuery에서 slideDown을 사용할 때
화면에서 특정 리스트를 클릭하면
클릭한 곳만 슬라이드 다운
그런데 다른 곳을 클릭하면 원래 슬라이드 다운된 곳이 슬라이드 업 되게 하고 싶은데
클릭된 것 이외의 다른 리스트는 어떻게 지정해야할까요?
현재 소스는 이러한 형태입니다.
$(this).find('.dropdown-menu').first().stop(true, true).slideDown(300);
|
답변 3개
채택된 답변
+20 포인트
this 대신 on()메소드에 있는 선택자를 넣어주시고,
slideDown() 대신 slideUp() 해주시면 되겠네요.
$(this).find('.dropdown-menu').first().stop(true, true).slideDown(300);
$(".Class").find('.dropdown-menu').first().stop(true, true).slideUp(300);
$("#ID").find('.dropdown-menu').first().stop(true, true).slideUp(300);
답변을 작성하려면 로그인이 필요합니다.