Search code examples
onsen-ui

Onsen UI: Get content height


I have tried everything but can't seem to get the height of the page content. I am using Onsen UI with JQuery. Can anyone provide me with an example?

I am trying to calculate the height minus the navbar so that I can adjust a map to full height.

Thanks!


Solution

  • You don't need to calculate any height, just put the map in a div and set the style to something like that:

    #map_canvas {
        position: absolute; 
        width:100%; 
        height: 100%; 
        margin: 0; 
        padding: 0;   
        z-index: -1
    }

    Anyway, if you really need the height of the current page, you can get it with JQuery using $('.page__content').height();