Javascript examples for jQuery Method and Property:jQuery Method Example
make an element collapse horizontally and then disappear
<html> <head> <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script> <style> #box{//from ww w . j a va 2 s . co m position:relative; width:300px; height:100px; background:red; } </style> </head> <body> <button>CLICK ME</button> <div id="box"></div> <script> $('button').click(function(){ $('#box').animate({width: "toggle" }); }); </script> </body> </html>