I’m building a website, which will be used on an iPad. The problem is, that I need to have 2 stylesheets:
One for when the user will see in fullscreen mode (without the address bar) and one for when the site opens standard in Safari.
Is it possible to make a line like:
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) {}
but when it is in fullscreen contra not?
In iOS 5 you should be able to target the size of the screen without the menu bar (which takes up exactly
18px), this way you’ll know it’s fullscreen, because it should be larger since the menu bar won’t be there:I’m not 100% if that’ll work, but I know the black bar at the top takes up
18px. And the dimensions would be as such:Update
I’ve found out how we can do this with jQuery, it relies on
window.navigator.standaloneNow this assumes that mobile safari supports
window.navigator.standaloneand it should. Give it a try.