<script type="text/javascript">
        $(function (){
            $(".links").click(function(){ 
            $('.slider').stop(true,false).animate({right:  "0" }, 800, 'easeOutQuint' ); },
        function(){ 
            $(".slider").stop(true,false).animate({right: "-200" }, 800, 'easeInQuint' ); },1000);
        });
   </script>
I am building a little slider on my website. The slider position is right: -200. It slides to position right:0 I want to animate it back to position right: -200 after clicking anywhere else on the page.
I tried all the ways which failed. toggle(slide) works good but doesn't looks good.
 
     
     
    