.animate() to add margin

bqcocttw

New Member
I am using the code to add margin to a div on click. It works perfectly, but I want to make it "animate" when it is adding margin for a sliding effect. How would I use .animate() to accomplish this?\[code\]<script type='text/javascript'>$(document).ready(function () { $('.menub').click(function() { if ($('.content').css('margin-left') == '300px') { $('.content').css('margin-left', '0px'); } else { $('.content').css('margin-left', '300px'); } }); $('.navigation a li').click(function() { $('.content').css('margin-left', '0px'); });});</script>\[/code\]
 
Back
Top