I'm trying to code a simple html page with a JQuery-mobile header and a map (using nokia here map api).
I want the map to fit the whole screen, so I tried to compute its height by taking the screen height and then subtracting the header height. After some attempts to get the right size, the result is good on every browser I tried except on Safari for Ipad: with the latter, the map has the right size, but the page can scroll a little if you touch the header and you can see about ten "extra pixels".
Here's the code (I have omitted the script to load the map):
- <div id="home" data-role="page" class="ui-responsive-panel" data-theme="a">
- <div data-role="header" id="header" data-position="fixed" data.theme="b">
- <h3>HEADER<h3>
- <div>
- <div data-role="content">
- <div class="ui-grid-solo" id="map">
- <div class="ui-block-a" id="bigMapContainer">
- </div>
- </div>
- </div>
- </div>
- $(window).ready(function (){
- var maxWidth = $(window).width();
- var maxHeight = $.mobile.getScreenHeight();
- var headerHeight = $('#header').outerHeight(true);
- var mapHeight = maxHeight - headerHeight;
- $('#map').css("height",mapHeight);
- }
I'm really getting crazy with this issue, since I really doesn't understand why the other browser seem to perform well the code. Does anyone has some tips?