How to Slideup Div Content on Button Click Using jQuery

Last Updated on September 3, 2022 by Roshan Parihar

Learn how to slideup div content on button click using jQuery. You have to use the slideUp() function to apply the slide-up effect to the div element.

The slide-up method is to hide the content with a sliding effect in jQuery. This is the animation effect that you can apply using jQuery.

Slideup Div Content On Button Click Using jQuery

The below example shows the button with the content inside the div element to display the slide-up method effect. You can also pass the speed of the slide-up effect by giving the speed as an argument of the slideUp() function.

Output

This is the div content to show the jQuery slideup method.


Click the button given above to slightly hide the div content with the sliding effect. The slideup means to hide the content with the sliding effect

If you want to perform the slideup effect with the specified speed, you have to pass the speed in a millisecond as the argument of slideUp(). Keep reading this post to find the example below with the speed of the slideup effect.

jQuery Slide up Div Content with Speed

The speed of the slideup effect when provide can make the sliding effect slow or fast. If you want to give the speed of second, you have to pass speed in milliseconds as the argument of the slideUp(). For 5 seconds speed, you have to pass 5000 as an argument.

Output

This is the div content to show the jQuery slideup method.


Check the speed of the slideup effect by clicking on the button given above. If you want to learn more about the sliding effect, you can visit our page.

You May Also Like to Read