How can add an value of 50 not set the left attribute left to 50?
document.getElementById("myDiv").style.left = "50px";
I am trying to get a smooth animation effect for my picture slider.
You could parse the value and add some value to it.
document.getElementById("myDiv").style.left =
(parseInt(document.getElementById("myDiv").style.left, 10) + 50) + 'px';
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments