source: main/trunk/greenstone3/web/interfaces/default/js/RequestAnimationFrame.js@ 32838

Last change on this file since 32838 was 26874, checked in by davidb, 11 years ago

Used in Panorama viewer

  • Property svn:executable set to *
File size: 541 bytes
Line 
1/**
2 * Provides requestAnimationFrame in a cross browser way.
3 * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
4 */
5
6if ( !window.requestAnimationFrame ) {
7
8 window.requestAnimationFrame = ( function() {
9
10 return window.webkitRequestAnimationFrame ||
11 window.mozRequestAnimationFrame ||
12 window.oRequestAnimationFrame ||
13 window.msRequestAnimationFrame ||
14 function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
15
16 window.setTimeout( callback, 1000 / 60 );
17
18 };
19
20 } )();
21
22}
Note: See TracBrowser for help on using the repository browser.