Home > Web Front-end > JS Tutorial > body text

Usage analysis of slideUp() method in jQuery_jquery

WBOY
Release: 2016-05-16 16:24:54
Original
1670 people have browsed it

The example in this article describes the usage of the slideUp() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:

This method dynamically hides all matching elements through height changes (decreasing upwards), and can also trigger a callback function after the hiding is completed.
The slideUp() method only adjusts the height of the element, allowing the matching element to be hidden in a "sliding" manner.

1. Grammar structure:
This method can specify the duration of the animation effect. If no time is specified, the default value normal is used. For example:

Copy code The code is as follows:
$("div").slideUp(5000)

The above code can set the animation effect to be completed within 5000 milliseconds (5 seconds).
This method can also trigger a callback function after the animation is completed. For example:
Copy code The code is as follows:
("div").slideUp(5000,function(){alert('to Slide down to complete! ')});

The above code can trigger the callback function after the animation is completed, so a prompt box pops up.
2. Example code:
Copy code The code is as follows:








Script Home








In the above code, click the button, the div will slowly pull up, and a dialog box will pop up after completion.

I hope this article will be helpful to everyone’s jQuery programming.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template