소스 검색

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