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);
});
jsBin demo
Give this a try and get rid of unneeded classes
EDIT
So far I understood you want an arrow that will toggle a container in-out so you might want this:
jsBin demo 2
Put the arrow INSIDE the container:
Style accordingly:
And on arrow -> click animate the parent container: