瀏覽代碼

Fixed Images rescaling on iPhone/iPod after scrolling #66 (joeworkman)

Jay Salvat 10 年之前
父節點
當前提交
70041b7ad8
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/jquery.vegas.js

+ 4 - 4
src/jquery.vegas.js

@@ -6,7 +6,6 @@
 // Copyright (C) 2013 Jay Salvat
 // Copyright (C) 2013 Jay Salvat
 // http://jaysalvat.com/
 // http://jaysalvat.com/
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-
 (function($) {
 (function($) {
     var $background = $('<img />').addClass('vegas-background'),
     var $background = $('<img />').addClass('vegas-background'),
         $overlay = $('<div />').addClass('vegas-overlay'),
         $overlay = $('<div />').addClass('vegas-overlay'),
@@ -18,8 +17,9 @@
         delay = 5000,
         delay = 5000,
         walk = function() {},
         walk = function() {},
         timer,
         timer,
+        isIPhone = (navigator.userAgent.match(/iPod|iPhone/i)),
+        IPhoneHeightOffset = 76,
         methods = {
         methods = {
-
         // Init plugin
         // Init plugin
         init : function(settings) {
         init : function(settings) {
             var options = {
             var options = {
@@ -420,8 +420,8 @@
         }
         }
 
 
         return {
         return {
-            width:  elmt[prop + 'Width' ],
-            height: elmt[prop + 'Height']
+            width:  elmt[prop + "Width"],
+            height: isIPhone ? elmt[prop + "Height"] + IPhoneHeightOffset : elmt[prop + "Height"]
         };
         };
     }
     }