javascript - jQuery animation function timing -
javascript - jQuery animation function timing -
feel i'm overlooking obvious here...
i've got several vars set so:
var productone = function () { $(".product2").fadein(200).animate({"right": "+=75px"}, 500, "easeoutelastic").delay(3000).fadeout(200).css("right", "0"); $(".product-text.two").fadein(200).delay(3500).fadeout(200); } var producttwo = function () { $(".product2").fadein(200).animate({"right": "+=75px"}, 500, "easeoutelastic").delay(3000).fadeout(200).css("right", "0"); $(".product-text.two").fadein(200).delay(3500).fadeout(200); } etc...then want fire them in order, so, , loop first:
window.setinterval(function() { $(producttwo); $(productthree); //and on }, 5000); but fire @ same time. how can set specific number of ms between each function call?
you need fire each 1 off end of previous one. productone settimeout phone call producttwo, , productrwo settimeout phone call productthree, , productthree phone call productone.
eta example:
var productone = function () { $(".product2").fadein(200).animate({"right": "+=75px"}, 500, "easeoutelastic").delay(3000).fadeout(200).css("right", "0"); $(".product-text.two").fadein(200).delay(3500).fadeout(200); settimeout(producttwo, 5000); } var producttwo = function () { $(".product2").fadein(200).animate({"right": "+=75px"}, 500, "easeoutelastic").delay(3000).fadeout(200).css("right", "0"); $(".product-text.two").fadein(200).delay(3500).fadeout(200); settimeout(productthree, 5000); } javascript jquery animation
Comments
Post a Comment