javascript - make div do -200px multiple times? -
i trying move div -200px original position when press button. want able multiple times.
function leftanimate(){ original = document.getelementbyid("sliderzelf").setattribute("style", "margin-left: -200px;"); }
this piece of code ( assume, correct me if im wrong.) sets attribute once -200px. there way can make -200px every new starting position?
since have used jquery-animate
tag, shall presume have jquery. in case following should work:
function leftanimate() { $("#sliderzelf").css("margin-left", "-=200"); }
Comments
Post a Comment