Last active
April 22, 2016 10:10
-
-
Save benhuson/8664741 to your computer and use it in GitHub Desktop.
Fix iOS 7 iPad Safari Landscape innerHeight/outerHeight layout issue
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
/** | |
* Add ipad IOS7 Classes | |
* Allows us to temporariliy try to fix the slight scroll 100% hack. | |
* http://stackoverflow.com/questions/19012135/ios-7-ipad-safari-landscape-innerheight-outerheight-layout-issue | |
*/ | |
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) { | |
$('html').addClass('ipad ios7'); | |
} | |
/** | |
* Fix for iPad iOS7 slight scroll on 100% body height | |
* http://stackoverflow.com/questions/19012135/ios-7-ipad-safari-landscape-innerheight-outerheight-layout-issue | |
*/ | |
@media (orientation:landscape) { | |
html.ipad.ios7 > body { | |
position: fixed; | |
bottom: 0; | |
width: 100%; | |
height: 672px !important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
This trick worked perfectly for me too. Thanks benhuson.
jandelvo i think understand your point but for the moment there is no fullscreen mode on ipad IO7. But you're right, we should make it flexible.
I just suggest to add an orientation detection to your code because your code is setting a height even on portrait (the css use the media querie orientation:landscape).