Need help with my code

Need help with my code

  1. $(document).ready(function(){
  2. var x = true;

  3. $("#Menubutton").click(function(){
  4. if (x == true) {
  5. $(".DropDown").slideUp(1000);
  6. $("#drop2").slideUp(1000);
  7. alert("true");
  8. x = false;
  9. }
  10. if( x == false) {
  11. $(".DropDown").slideDown(1000);
  12. $("#drop2").slideDown(1000);
  13. alert("false");
  14. x = true;
  15. }
  16. });
  17. });
To my Problem I want to click on a button (div) and want to slideUp a div. And when i click it on the second time i want that it slide down. Have anybody an idea how i can solve my problem?

Thank you