How do I put a variable in a string in JavaScript?
Example:
$(\'#contactForm\').animate({\"marginLeft\": \"+=680px\"}, \"slow\");
I wou
You can use the + operator to concatenate your value in a variable to the "+=" string:
+
"+="
$('#contactForm').animate({"marginLeft": "+=" + size}, "slow");