Javascript examples for jQuery:Slide
Toggle between sliding up and down the <div> element, when clicking the button in duration of 1000 milliseconds.
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("div").slideToggle(1000); });/*from www .ja v a2 s .c om*/ }); </script> </head> <body> <button>Click to slide up/down div</button><br><br> <div style="width:80px;height:80px;background-color:red;"></div> </body> </html>