$("#sanjiaoLeft").css("marginLeft",val); $("#sanjiaoLeft").css({"margin-left": val, "background-color": "blue" });