html - (jQuery mobile) how to let main div wrap the rest between header and footer? -


this html code wrote using jquery mobile

<div data-role="page" id="map-page"> <div data-role="header" data-theme="a" data-position="fixed"     data-fullscreen="true" data-tap-toggle="false">     <h1>header</h1> </div>  <div data-role="main" class="ui-content" id="map_canvas">     <div id="map"></div> </div>  <div data-role="footer" data-theme="a" data-position="fixed"     data-fullscreen="true" data-tap-toggle="false">     <h1>footer</h1> </div> 

id=map google map. and.. css

<style>     #map-page{         width: 100%;         height: 100%;         padding: 0;     }     #map-canvas{         position: relative;         overflow: hidden;         min-height:100%;         height:auto !important;     }     #map{         position: absolute;         top: 0px;         left: 0px;         height: 100%;         width: 100%;     } </style> 

in situation google map covers area under header , footer. can see top , bottom of map through header&footer cloudy. want map wrap rest between header , footer. how can that?

thank you.

you dont need specify fixed header , footer.

<!doctype html>  <html>  <head>  <meta name="viewport" content="width=device-width, initial-scale=1">  <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">  <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>  <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>  </head>  <body>    <div data-role="page">    <div data-role="header">      <h1>welcome homepage</h1>    </div>      <div data-role="main" class="ui-content">     <div id="map" style="width:400px;height:400px;"></div>    </div>      <div data-role="footer">      <h1>footer text</h1>    </div>  </div>     </body>  <script>  function mymap() {  var mapoptions = {      center: new google.maps.latlng(51.5, -0.12),      zoom: 10,      maptypeid: google.maps.maptypeid.hybrid  }  var map = new google.maps.map(document.getelementbyid("map"), mapoptions);  }  </script>    <script src="https://maps.googleapis.com/maps/api/js?key=aizasybu-916ddpkajtmjnigngs6hl_kdiku0au&callback=mymap"></script>  </html>


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -