summaryrefslogtreecommitdiff
path: root/lib/gallery.common.js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-30 06:00:10 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-30 06:00:10 -0700
commitd34c6b6fb398f7b5f529dd2524fe0895a4b92e8c (patch)
tree67e34e5dc1779e9b750664fe6b9244321c18d8c1 /lib/gallery.common.js
parentfc7ef17e0fb08459a84ba9ba0654664e519e6a0f (diff)
Move the getViewportSize method to gallery.common.js
Diffstat (limited to 'lib/gallery.common.js')
-rw-r--r--lib/gallery.common.js18
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);