From d34c6b6fb398f7b5f529dd2524fe0895a4b92e8c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 30 Jul 2009 06:00:10 -0700 Subject: Move the getViewportSize method to gallery.common.js --- lib/gallery.common.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/gallery.common.js') 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); -- cgit v1.2.3