jQuery move div left on click then right on click
问题 I have a div that sits just off the right of my screen (-190px). When I click another div (called coffee) I want the offscreen div to appear, then when I click the coffee div again, I want the other div to move offscreen again. Currently my code moves it on screen then immediately back off. $('span.coffee').click(function(){ $('.quick_contact').animate({'right' : '0px'}); }); $('span.coffee').click(function(){ $('.quick_contact').animate({'right' : '-190px'}); }); How can I make it so that it