I'm making a webpage that requires several functions to run once the user scrolls past certain points. I have setInterval(func) set at 25, and I haven't been having any problems getting the page to run well. However I'm not really sure whether this is a "good" general purpose value to use.
Basically I'm new to web development so I'd like to know what the best practices are for handling this and whether there is a better way than checking every 25 ms. I tried setting the interval really low and it froze the browser, so I'd REALLY like to avoid that.
It doesn't seem to work on my tablet so I'm just gonna say this feature would only run on desktop.
Aucun commentaire:
Enregistrer un commentaire