javascript - Problem waiting til function has finished executing before it tries to execute again -
I am using $ (window) .scroll (); When a user is close to the top or bottom of the sloals, a second to execute the function to specify the function to call
takes another, and if they keep scrolling, Implemented several times before.
Is there any way to start the function from which I execute and then tell the $ (window) .scroll () function that it needs to wait before re-implementing that function? You can set a boolean that you are already checking the scroll position:
checking = condition = false; $ Window.scroll (function () {if (checkingPosition) returns; checking = status; // do stuff; position = false;});
Comments
Post a Comment