Check out the Underscore.js library’s “throttle” method.
http://underscorejs.org/#throttle
The example it gives is exactly what you’re asking about – limiting how often you have to handle scroll events.
More Related Contents:
- How to force browser to show image 3 inches wide?
- Are ‘Arrow Functions’ and ‘Functions’ equivalent / interchangeable?
- load and execute order of scripts
- Why doesn’t indexOf work on an array IE8?
- Executing injected by innerHTML after AJAX call
- How is almost everything in Javascript an object?
- Mongoose and multiple database in single node.js project
- Handling errors in Promise.all
- babel-loader jsx SyntaxError: Unexpected token [duplicate]
- How to concatenate properties from multiple JavaScript objects
- How get total sum from input box values using Javascript?
- JavaScript Time Zone is wrong for past Daylight Saving Time transition rules
- Border Radius for IE8
- Knockout.js incredibly slow under semi-large datasets
- Using Jasmine to spy on a function without an object
- jQuery/Javascript function to clear all the fields of a form [duplicate]
- How to set javascript variables using MVC4 with Razor
- Copy to clipboard without Flash
- Express and ejs
- Effect of declared and undeclared variables
- How Do I Stop My Web Content From Shifting Left When The Vertical Scrollbar Appears? Roll-Up of Advice 2017 [duplicate]
- What are express.json() and express.urlencoded()?
- jQuery UI Dialog Box – does not open after being closed
- How to create an array of object literals in a loop?
- Upgrade to Babel 7: Cannot read property ‘bindings’ of null
- Something happened to my google map api script
- Getting the text from a drop-down box
- jQuery JSONP ajax, authentication header not being set
- How to set up Python server side with javascript client side
- Regex: only alphanumeric but not if this is pure numeric