Recent Posts
Link
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
관리 메뉴

공부하자

제이쿼리(J-Query) 메소드 slideUp, slideDown, slideToggle 본문

J-Query·JavaS

제이쿼리(J-Query) 메소드 slideUp, slideDown, slideToggle

bluemoon527 2021. 1. 8. 01:30

제이쿼리 slideUp, slideDown, slideToggle 메소드

: 슬라이드 애니메이션 효과를 구현해주는 메소드

 

 

 

문법 

$("element").slideUp(time);

$("element").slideDown(time);

$("element").slideToggle(time);

 

 

 

1. $("element").slideUp(time);

: 선택한 요소가 서서히 올라가면서 사라지는 효과

 

ex.

$(".wrap .box").slideUp(2000);  // 1000 = 1초

 

 

2. $("element").slideDown(time);

: 선택한 요소가 서서히 내려가면써 나타나는 효과

 

ex.

$(".wrap .box").slideDown(5000);

 

 

3. $("element").slideToggle(time);

: 선택한 요소의 표시 상태에 따라 다른 동작을 나타낸다. 

ex. display:none 처리 되어있다면 slideDown 효과를 나타냄

 

ex.

$(".wrap .box").slideToggle(5000);

 

 

 

 

 

api.jquery.com/slideUp/

 

.slideUp() | jQuery API Documentation

Description: Hide the matched elements with a sliding motion. The .slideUp() method animates the height of the matched elements. This causes lower parts of the page to slide up, appearing to conceal the items. Once the height reaches 0 (or, if set, to what

api.jquery.com

 

Comments