Commit eb7e961f

luu stiles <luuduong@gmail.com>
2012-08-09 12:50:13
updated colorbox js to check viewport size and make popup fit the screen so now it works nicely on iphones
1 parent 86be616
Changed files (1)
app
assets
javascripts
app/assets/javascripts/creations.js
@@ -29,6 +29,17 @@ Creations.Crop = {
 };
 Creations.Show = {
   initialize: function(){
-    $('.gallery').colorbox({rel:'gallery', width: "960px"});
+    $('.gallery').colorbox({rel:'gallery', width:function(){
+	        var width = '100%', viewport = $(window).width();
+	        if (viewport > 960) {
+	                width = '50%';
+	        } else if (viewport >= 768) {
+	                width = '80%';
+	        }
+	        return width;
+			}
+			
+			});
+
   }
 };