Question: I have an animation which works fine. But I can't reverse it. Can someone please give me a hint?

```
$(".arrowclose").click(function() {
    $(".arrow").animate({ left: "218px" }, 1000, "easeOutQuad");                
    setTimeout(function() {
        $(".arrow").addClass("arrow_right arrowopen");
        $(".arrow").removeClass("arrow_left arrowclose");
}, 1000);
});

$(".arrowopen").click(function() {
    $(".arrow").animate({ left: "486px" }, 1000, "easeOutQuad");
    setTimeout(function() {
        $(".arrow").addClass("arrow_left arrowclose");
        $(".arrow").removeClass("arrow_right arrowopen");
    }, 1000);
});

```

Answer: 
`**[jsBin demo](http://jsbin.com/opujov/2/edit)**`

Give this a try and get rid of unneeded classes

```
$(".arrow").click(function() {     
   $(this).stop().animate({ left: $(this).offset().left > 218 ? 218 : 486 }, 1000, "easeOutQuad", function() {
       $(this).toggleClass("arrowopen, arrowclose");
   });
});

```

**EDIT**

So far I understood you want an arrow that will toggle a container in-out so you might want this:

`**[jsBin demo 2](http://jsbin.com/opujov/7/edit)**`

Put the arrow INSIDE the container:

```
  <div class="wrapcontent">
    Test
    <div class="arrow arrowopen"></div>
  </div>

```

Style accordingly:

```
.arrowopen{
  position:absolute;
  right:-20px;
  top:0px;
  cursor:pointer;
  width:20px;
  height:20px;
}
.arrowopen  {background:#cf5;}
.arrowclose {background:#f00;}

.wrapcontent {

 position:absolute;
 width: 300px;
 height:100px;
 background:#888;
 left:-300px;

}

```

And on arrow -> click animate the parent container:

```
$(".arrow").click(function() {  

   $wrapcontent = $(this).closest('.wrapcontent');
   wrapOffset = $wrapcontent.offset().left;

   $wrapcontent.stop().animate({ left: !wrapOffset ? -300 : 0 }, 1000, "easeOutQuad");
   $(this).toggleClass("arrowopen, arrowclose");

});

```
This is because you are using click event on element which doesn't exist on DOM ready (your arrowopen class). You should use .on() jQuery method -> <http://api.jquery.com/on/>