Created
October 8, 2013 23:52
-
-
Save srobbin/6893837 to your computer and use it in GitHub Desktop.
A quick workaround for Backstretch on iOS7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i)) { | |
$("body").css({ | |
"background": "url(path/to/image.jpg) center center no-repeat", | |
"background-size": "cover" | |
}); | |
} else { | |
$.backstretch("path/to/image.jpg"); | |
} |
Hi Scott,
Thank you so much for your wonderful Backstretch! For months I had been looking for code to use on welcome pages with multiple/random backgrounds. Your code not only does exactly what I wanted, but it does it very well, even in older browsers like IE8. Thank you again so very much. -Billy
Test page: http://www.guyarseneau.com/welcome-summer-test.php
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this needs 'iPad' removing as it produced some weird results for me with it in (there's no bottom UI on iOS7 iPad Safari). All fine without it though, thanks!