At least on iOS6, but probably on more browsers, the resize-event can be triggered before the image has been loaded and/or the ratio of the image is know.
The method already has a try/catch block in place for IE7, but it should also just check for isNaN() on the calculated bgHeight so it can stop further processing in that case.
At least on iOS6, but probably on more browsers, the resize-event can be triggered before the image has been loaded and/or the ratio of the image is know.
The method already has a try/catch block in place for IE7, but it should also just check for isNaN() on the calculated bgHeight so it can stop further processing in that case.