diff --git a/src/openseadragon.js b/src/openseadragon.js index 22ca56e9..dad43393 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -952,6 +952,20 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ }, + /** + * Returns the current milliseconds, using Date.now() if available + * @name $.now + * @function + */ + now: function( ) { + if (Date.now) { + $.now = Date.now; + } else { + $.now = function() { return new Date().getTime(); }; + } + }, + + /** * Ensures an image is loaded correctly to support alpha transparency. * Generally only IE has issues doing this correctly for formats like