jquery-backstretch / jquery-backstretch

Backstretch is a simple jQuery plugin that allows you to add a dynamically-resized, slideshow-capable background image to any page or element. The image will stretch to fit the page/element, and will automatically resize as the window/element size changes.
http://www.jquery-backstretch.com
MIT License
3.91k stars 913 forks source link

Landscape mode Ipad #6

Closed gideonvd closed 13 years ago

gideonvd commented 13 years ago

When you hold the Ipad in landscape mode the background fills the view-port fine but scrolling down cut's it off. The same would happen without background-attachment: fixed;

srobbin commented 13 years ago

Give the latest version a try. I added a hack to account for iOS, so that it uses $(document) instead of $(window) to get the correct height. Let me know if it does/doesn't work.

srobbin commented 13 years ago

And by latest version, I mean the one from Github, not from my website. If this works, I'll include it in version 1.1.

gideonvd commented 13 years ago

Hey Scott, I finally got this bloody gizmo online. Sorry for the long wait. The added code works well. It has however one nasty side-effect. The background-attachment seems no longer fixed. Scrolling a page in landscape mode also scrolls the bg. The background seems attached to the content rather than to the viewport.

srobbin commented 13 years ago

Ah, yeah, that's a problem with Mobile WebKit, not Backstretch itself. Mobile WebKit/Safari doesn't support position:fixed.

http://blog.mspace.fm/2009/10/01/iphone-mobile-safari-css-position-fixed/

There are a few workarounds, but none of them with work with this plugin.