I make a component like a scroller of pictures. When the div element is shifted in the for loop (changing the marginLeft), the div = offset does not occur (at the end of the loop, the div stupidly appears at the new point. How to make the div offset as if by frames (so that you can see the offset for each pixel) .
var el = document.getElementById("div2"); for(i=0; i<img_w; i++){ ml--; el.style.marginLeft = ml + "px"; } /* img_w - это размер картинки по ширине ml - это переменная в которой хранится текущее MarginLeft (по умолчанию ml=0) */
thanks in advance.
jQuery
for example theanimate
method - webkostya