diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-30 21:00:10 +0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-31 20:43:34 +0800 |
commit | 64aa96b5527b0a887800bb4d7868495b4397da74 (patch) | |
tree | 5892252d0041cd573c7ac55473698a33161772f5 | |
parent | 19d89f94f9939bbd879d6c8ead4e802f592ec808 (diff) |
Move the getViewportSize method to gallery.common.js
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
-rw-r--r-- | lib/gallery.common.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 14c28a56..599f23d1 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -27,3 +27,21 @@ }); }; })(jQuery); + +// Get the viewport size +(function () { + $.getViewportSize = function() { + return { + width : function() { + return window.innerWidth + || document.documentElement && document.documentElement.clientWidth + || document.body.clientWidth; + }, + height : function() { + return window.innerHeight + || document.documentElement && document.documentElement.clientHeight + || document.body.clientHeight; + } + }; + }; +})(jQuery); |