Method: 1. Use slideUp(), the syntax "$("element").slideUp(milliseconds)" will hide the selected element in a sliding manner; 2. Use slideToggle(), the syntax "$( "Element").slideToggle(milliseconds)", when the element is in the display state, the element will be hidden in a sliding manner.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
jquery method to realize the element sliding up and disappearing
1. Use slideUp()
The slideUp() method hides the selected elements in a sliding manner.
Note: Hidden elements will not be fully displayed (no longer affect the layout of the page).
2. Use slideToggle()
slideToggle() will check the visible state of the selected element. If an element is If an element is visible, the element will be hidden by sliding up; if an element is hidden, the element will be displayed by sliding down.
[Recommended learning:jQuery video tutorial,web front-end video】
The above is the detailed content of How to make elements slide up and disappear in jquery. For more information, please follow other related articles on the PHP Chinese website!