Metoda jQuery slideDown()

❮ Metody efektów jQuery

Przykład

Przesuń w dół (pokaż) wszystkie ukryte <p> elementy:

$("button").click(function(){
  $("p").slideDown();
});

Definicja i użycie

Metoda slideDown() przesuwa w dół (pokazuje) wybrane elementy.

Uwaga: slideDown() działa na elementach ukrytych za pomocą metod jQuery i display:none w CSS (ale nie widoczności:ukryty).

Wskazówka: Aby wysunąć (ukryć) elementy, spójrz na metodę slideUp() .


Składnia

$(selector).slideDown(speed,easing,callback)

Parameter Description
speed Optional. Specifies the speed of the slide effect. Default value is 400 milliseconds

Possible values:

  • milliseconds
  • "slow"
  • "fast"
easing Optional. Specifies the speed of the element in different points of the animation. Default value is "swing"

Possible values:

  • "swing" - moves slower at the beginning/end, but faster in the middle
  • "linear" - moves in a constant speed
Tip: More easing functions are available in external plugins.
callback Optional. A function to be executed after the slideDown() method is completed

To learn more about callback, visit our jQuery Callback chapter


Spróbuj sam - przykłady


Jak używać parametru szybkości do określenia szybkości efektu slajdu.


Jak używać parametru wywołania zwrotnego podczas przesuwania w górę iw dół wybranych elementów.


❮ Metody efektów jQuery