English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The slideUp() method hides the selected element in a sliding manner.
Note:Hidden elements will no longer affect the page layout.
This method is usually used withslideDown()Methods can be used together.
$(selector).slideUp(duration, easing, callback)
When clicking "#my-Div" hides the " .panel" on the page when this example is clicked:
$("#my-Div").click(function(){ $(".panel").slideUp(); });Test to see‹/›
Slide up all <p> elements when the button is clicked:
$("button").click(function(){ $("p").slideUp(); });Test to see‹/›
UsedurationParameters:
$("button").click(function(){ $("p").slideUp(1500); });Test to see‹/›
UsecallbackParameters:
$("button").click(function(){ $("div").slideUp(1500, function(){ alert("Slide up completed!"); }); });Test to see‹/›
Use a slow duration and linear easing to slide up all " .panel":
$("#my-Div").click(function(){ $(".panel").slideUp("slow", "linear"); });Test to see‹/›
Animate all spans (in this example, words) to slide quickly, in200毫秒内完成每个动画:
$("button").click(function(){ -child $(this).prev().slideUp("fast", arguments.callee); }); });Test to see‹/›
Parameter | Description |
---|---|
duration | An optional value to determine how long the sliding effect will last. The preset value is400 milliseconds Possible values:
|
easing | An optional string that specifies the speed of the element at different points in the animation. The default value is "swing" Possible values:
|
callback | A function called once the slideUp() method is completed, for each selected element |