jQuery slideUp() and slideDown()

slideUp() hides an element with a vertical sliding animation, while slideDown() reveals a hidden element by expanding it vertically.

Example Element Top ↑

<div id="d1" class="msg">Slide this layer with the buttons.</div>

slideUp() and slideDown() Top ↑

$("#d1").slideUp();
$("#d1").slideDown();

Control Sliding with Buttons Top ↑

$("#b1").on("click", function () {
    $("#d1").slideUp();
});

$("#b2").on("click", function () {
    $("#d1").slideDown();
});

Demo: slide up and slide down →

Set the Slide Duration Top ↑

$("#d1").slideUp("slow");
$("#d2").slideDown("fast");
$("#d3").slideUp(5000);

Demo: compare slide durations →

If one control should alternate between both states, use slideToggle().

← Previous: fadeTo() · jQuery Effects · Next: slideToggle() →






plus2net.com






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer