I have a variable called direction that stores either: left
, right
.
I need to change the affected margin based on that variable.
Right now I'm using conditions, is it possible to replace "left" with the output of the variable direction
?
$("#map").animate({"margin-left": "+=50px"}, 500);