I've written a few functions and need to execute them one after another endlessly.
var bGposition = $("ul.sigProClassic li.sigProThumb a.sigProLink img.sigProImg");
function posDown() {
bGposition.css({
backgroundPosition: "0% 0%",
}).animate({
backgroundPositionX: '100%',
backgroundPositionY: '100%',
}, 3000)
}
function posUp() {
bGposition.css({
backgroundPosition: "100% 100%",
}).animate({
backgroundPositionX: '0%',
backgroundPositionY: '0%',
}, 3000)
}
posUp();
posDown();
posUp();
posDown();
I've already found a way to make it work, but I need to call a function every time manually.
The problem is, when using a callback I'm getting a "maximum call stack size exceeded" error, after that it's starting to work.
setTimeout is not working in this case.
How can i fix it? Please help!
P.S. Sorry for my English!
setIntervalnotsetTimeoutfor something to repeat after x amount of time,setTimeoutis just setting a delay not repetition