From f3f518b62a9ae68b69832120a55470ab85afd3fa Mon Sep 17 00:00:00 2001 From: Scott Robbin Date: Thu, 5 Aug 2010 17:13:29 -0500 Subject: [PATCH] Fixed window resizing issue. --- jquery.backstretch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.backstretch.js b/jquery.backstretch.js index 27e5a6f..f04763e 100755 --- a/jquery.backstretch.js +++ b/jquery.backstretch.js @@ -18,8 +18,7 @@ speed: 0 // fadeIn speed for background after image loads (e.g. "fast" or 500) }, rootElement = ("onorientationchange" in window) ? $(document) : $(window), // hack to acccount for iOS position:fixed shortcomings - imgRatio, bgImg, bgWidth, bgHeight, bgOffset, - bgCSS = {left: 0, top: 0}; + imgRatio, bgImg, bgWidth, bgHeight, bgOffset, bgCSS; // Extend the settings with those the user has provided if(options && typeof options == "object") $.extend(settings, options); @@ -57,6 +56,7 @@ } function _adjustBG(fn) { + bgCSS = {left: 0, top: 0} bgWidth = rootElement.width(); bgHeight = bgWidth / imgRatio;