Jump to content


Photo

Infinite Animate Is Late


  • Please log in to reply
1 reply to this topic

#1 TheEagle

TheEagle

    Member

  • Member
  • PipPip
  • 41 posts

Posted 08 November 2013 - 06:01 PM

Hi

I'm trying to make an infinite animate (loop).So I call the same function as a callback function.It works but I observed when the callback function is called (which is the same function) it takes some time.Is there any better way or a solution for that delay? Following is the code I use:

$(document).ready(function () {
scroll();
});

function scroll() {
$("#divtomove").css("left", "-150px");
$("#divtomove").animate({ left: "300px" }, 20000, scroll);
}
  • 0

#2 TheEagle

TheEagle

    Member

  • Member
  • PipPip
  • 41 posts

Posted 08 November 2013 - 06:21 PM

Hi

I'm trying to make an infinite animate (loop).So I call the same function as a callback function.It works but I observed when the callback function is called (which is the same function) it takes some time.Is there any better way or a solution for that delay? Following is the code I use:

$(document).ready(function () {
scroll();
});

function scroll() {
$("#divtomove").css("left", "-150px");
$("#divtomove").animate({ left: "300px" }, 20000, scroll);
}


I found the Div size was bigger than I thought so part of the delay was not real(sorry).A little part which looks real is at the end of the animation (before calling the callback function)the animation becomes abit slow but it is not important...
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

★★★★★ 5 Star Rated Web Developer Course - check it out now!