Animate both in and out with the same button...

Animate both in and out with the same button...

  1. <script type="text/javascript">
  2.       $(document).ready(function()
          {
              $("#bgchooser_button").click(function()
              {
                  $("#bgchooser").animate(
                  {
                      width: "700px",
                      height: "130px"
                  }, 750);
              });
          });










  3. </script>

  4. <div id="bgchooser_button">
        <a href="javascript: void(0);"><img src="picture.png" /></a>
    </div>
    <div id="bgchooser">
        TEST
    </div>





How can I make my link animate my #bgchooser in onclick and out if it has animated in? Like one link to do 2 things depending on the state of the #bgchooser (animated in or out...)