PageSourceSearch

https://nobts.edu/_skin/assets/plugins/ilightbox/js/jquery.requestAnimationFrame.js

js nobts.edu collected 2026-09-24 09:44:16 UTC 1,874 bytes, 58 lines download raw bytes

1(function($, window, undefined) {
2    // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
3    // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
4 
5    // requestAnimationFrame polyfill by Erik Möller
6    // fixes from Paul Irish and Tino Zijdel
7 
8    var lastTime = 0,
9        running,
10        animate = function (elem) {
11            if (running) {
12                window.requestAnimationFrame(animate, elem);
13                jQuery.fx.tick();
14            }
15        },
16        vendors = ['ms', 'moz', 'webkit', 'o'];
17 
18    for(var x = 0, len = vendors.length; x < len && !window.requestAnimationFrame; ++x) {
19        window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
20        window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
21            || window[vendors[x]+'CancelRequestAnimationFrame'];
22    }
23 
24    if (!window.requestAnimationFrame)
25        window.requestAnimationFrame = function(fn, element) {
26            var currTime = new Date().getTime(),
27                delta = currTime - lastTime,
28                timeToCall = Math.max(0, 16 - delta);
29 
30            var id = window.setTimeout(function() {
31                    fn(currTime + timeToCall);
32                },
33                timeToCall
34            );
35 
36            lastTime = currTime + timeToCall;
37 
38            return id;
39        };
40 
41    if (!window.cancelAnimationFrame) {
42        window.cancelAnimationFrame = function(id) {
43            clearTimeout(id);
44        };
45    }
46 
47    jQuery.fx.timer = function (timer) {
48        if (timer() && jQuery.timers.push(timer) && !running) {
49            running = true;
50            animate(timer.elem);
51        }
52    };
53 
54    jQuery.fx.stop = function() {
55        running = false;
56    };
57 
58}(jQuery, this));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.