I have a PNG that moves around the screen in a repeating loop, which I believe may cause some browsers to crash.
For instance:
function parachute_drop(drop_object, animation_duration) { $(drop_object) .animate({top: "750px"},animation_duration) .animate({top:"-150px", opacity: 100 },{ duration: 0, complete: function(){ parachute_drop(drop_object,animation_duration); } }); } parachute_drop('#object_id',10000);
Each time the animation ends, it launches the function again and to infinity.
I did not see this being problematic, but I heard that it is not very good and good, my site is now crashing after a while it seems.
Is there a way to make endless loops like this in a more stable way? It seems a little strange that just moving a 9 kilobyte PNG file up and down the screen over and over again is a strain on system resources. What is the problem and how do I approach this better?
source share