title: How can I make this animated div returning in one button?
body: <pre><code>&lt;script&gt;
  $("#right").click(function(){
    $(".block").animate({"left": "+100px"}, "slow").fadeTo("slow", 0.33);
  });
  
  $("#left").click(function(){
    $(".block").animate({"left": "+50px"}, "slow").fadeTo("slow", 0.99);;
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>this is my script.
  as you see, i want to move  .block to left and right using button, but i can't find how to make it work in one button.</p>
  
  <p>so i want the button to trigger  .block to move right (at the first click) and after it moves, trigger  .block to move left(second click). and can work repeatedly.</p>
  
  <p>how can i do that?
  should i use 'if' function?</p>