javascript - jquery delay/animate start bugging after some time and overlapping -
i got work on piece of jquery code runs simple slider of 3 images, shows , hides them 1 one, , should repeat process indefinitely.
here code:
$(document).ready(function () { function start_slider() { $('#slider_img_1').animate({ top: '-=495' }, 1000).delay(4000).animate({ top: '+=495' }, 1000); $('#slider_img_2').delay(6000).animate({ top: '-=495' }, 1000).delay(4000).animate({ top: '+=495' }, 1000); $('#slider_img_3').delay(12000).animate({ top: '-=495' }, 1000).delay(4000).animate({ top: '+=495' }, 1000); settimeout(function () { start_slider(); }, 18000); } start_slider(); });
now far understand this, animates first picture 1s, holds 4s , animates 1s. same other 2. math fits in? last 18s in total , starts again.
problem: it works maybe 3-5min, see 2 images overlap once. after 10min start overlapping more , increases on time.
what problem? (note: same bug in firefox , chrome)
Comments
Post a Comment