Tuesday, 15 June 2010

Jquery animate duration: movement not smooth enought -


This is the time I am writing here. I have some problems with JQuery Chetan: When the period is really slow (for example, 10000), movements are not easy. I need a "natural" movement for my div. Does anyone know the solution to my problem? Or can you give me advice on what to do? Thanks !!!! Code is something like: prefix function moveFoo () {var timeFoo = setInterval (function () {var $ foo = $ ("# foo"); $ foo.animate ({"top" : "- = 10px"}, 20000, "linear"); $ foo.animate ({"top": "+ = 10px"}, 20000, "linear");}, 1); }; MoveFoo ();

You should look at the requestanimationframe and / or use a twing engine which is requestanimationframe's Uses Timer based animations that are used in the jQuery Towing Engine, they are not efficient and timers are due to incompatible animation.



No comments:

Post a Comment