diff options
Diffstat (limited to 'lib')
-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); |