js/OverlayScrollbars.js
function() {
                    if(_loopingInstances[_strLength] > 0 && _loopIsActive) {
                        _loopID = COMPATIBILITY.rAF()(function () {
                            loop();
                        });
                        var timeNew = COMPATIBILITY.now();
                        var timeDelta = timeNew - _loopTimeOld;
                        var lowestInterval;
                        var instance;
                        var instanceOptions;
                        var instanceAutoUpdateAllowed;
                        var instanceAutoUpdateInterval;
                        var now;

                        if (timeDelta > _loopInterval) {
                            _loopTimeOld = timeNew - (timeDelta % _loopInterval);
                            lowestInterval = _loopIntervalDefault;
                            for(var i = 0; i < _loopingInstances[_strLength]; i++) {
                                instance = _loopingInstances[i];
                                if (instance !== undefined) {
                                    instanceOptions = instance.options();
                                    instanceAutoUpdateAllowed = instanceOptions[_strAutoUpdate];
                                    instanceAutoUpdateInterval = MATH.max(1, instanceOptions[_strAutoUpdateInterval]);
                                    now = COMPATIBILITY.now();

                                    if ((instanceAutoUpdateAllowed === true || instanceAutoUpdateAllowed === null) && (now - _loopingInstancesIntervalCache[i]) > instanceAutoUpdateInterval) {
                                        instance.update('auto');
                                        _loopingInstancesIntervalCache[i] = new Date(now += instanceAutoUpdateInterval);
                                    }

                                    lowestInterval = MATH.max(1, MATH.min(lowestInterval, instanceAutoUpdateInterval));
                                }
                            }
                            _loopInterval = lowestInterval;
                        }
                    } else {
                        _loopInterval = _loopIntervalDefault;
                    }
                }
function() {
                    if(_loopingInstances[_strLength] > 0 && _loopIsActive) {
                        _loopID = COMPATIBILITY.rAF()(function () {
                            loop();
                        });
                        var timeNew = COMPATIBILITY.now();
                        var timeDelta = timeNew - _loopTimeOld;
                        var lowestInterval;
                        var instance;
                        var instanceOptions;
                        var instanceAutoUpdateAllowed;
                        var instanceAutoUpdateInterval;
                        var now;

                        if (timeDelta > _loopInterval) {
                            _loopTimeOld = timeNew - (timeDelta % _loopInterval);
                            lowestInterval = _loopIntervalDefault;
                            for(var i = 0; i < _loopingInstances[_strLength]; i++) {
                                instance = _loopingInstances[i];
                                if (instance !== undefined) {
                                    instanceOptions = instance.options();
                                    instanceAutoUpdateAllowed = instanceOptions[_strAutoUpdate];
                                    instanceAutoUpdateInterval = MATH.max(1, instanceOptions[_strAutoUpdateInterval]);
                                    now = COMPATIBILITY.now();

                                    if ((instanceAutoUpdateAllowed === true || instanceAutoUpdateAllowed === null) && (now - _loopingInstancesIntervalCache[i]) > instanceAutoUpdateInterval) {
                                        instance.update('auto');
                                        _loopingInstancesIntervalCache[i] = new Date(now += instanceAutoUpdateInterval);
                                    }

                                    lowestInterval = MATH.max(1, MATH.min(lowestInterval, instanceAutoUpdateInterval));
                                }
                            }
                            _loopInterval = lowestInterval;
                        }
                    } else {
                        _loopInterval = _loopIntervalDefault;
                    }
                }
function ( ) { if ( _loopingInstances [ _strLength ] > 0 && _loopIsActive ) { _loopID = COMPATIBILITY . rAF ( ) ( function ( ) { loop ( ) ; } ) ; var timeNew = COMPATIBILITY . now ( ) ; var timeDelta = timeNew - _loopTimeOld ; var lowestInterval ; var instance ; var instanceOptions ; var instanceAutoUpdateAllowed ; var instanceAutoUpdateInterval ; var now ; if ( timeDelta > _loopInterval ) { _loopTimeOld = timeNew - ( timeDelta % _loopInterval ) ; lowestInterval = _loopIntervalDefault ; for ( var i = 0 ; i < _loopingInstances [ _strLength ] ; i ++ ) { instance = _loopingInstances [ i ] ; if ( instance !== undefined ) { instanceOptions = instance . options ( ) ; instanceAutoUpdateAllowed = instanceOptions [ _strAutoUpdate ] ; instanceAutoUpdateInterval = MATH . max ( 1 , instanceOptions [ _strAutoUpdateInterval ] ) ; now = COMPATIBILITY . now ( ) ; if ( ( instanceAutoUpdateAllowed === true || instanceAutoUpdateAllowed === null ) && ( now - _loopingInstancesIntervalCache [ i ] ) > instanceAutoUpdateInterval ) { instance . update ( 'auto' ) ; _loopingInstancesIntervalCache [ i ] = new Date ( now += instanceAutoUpdateInterval ) ; } lowestInterval = MATH . max ( 1 , MATH . min ( lowestInterval , instanceAutoUpdateInterval ) ) ; } } _loopInterval = lowestInterval ; } } else { _loopInterval = _loopIntervalDefault ; } }
The auto update loop which will run every 50 milliseconds or less if the update interval of a instance is lower than 50 milliseconds.
The auto update loop which will run every 50 milliseconds or less if the update interval of a instance is lower than 50 milliseconds .