slideToggle() alternates between slideUp() and slideDown(), making it useful for expandable sections, simple disclosures, and show/hide panels.
$("#d1").slideToggle();
$("#b2").on("click", function () {
$("#d1").slideToggle();
});
$("#d1").slideToggle("slow");
$("#d1").slideToggle(500);
Demo: slideToggle() with different durations →
← Previous: slideUp() / slideDown() · jQuery Effects · Next: animate() →
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.
| php designer | 13-06-2017 |
| Great tutorial. This tutorial was really helpful to known the slide toggle jquery function. Its helpful to beginners. Thanks. | |