css - Fullscreen map with Semantic UI -


i'm trying display semantic-ui sidebar , full-screen map.

the deal construct map events toggle sidebar(s). problem css.

i'm able show expected, i'm having first item on menu shown, pushing lot of stuff down.

this relevant html structure:

<body> <div class="ui sidebar vertical menu">     <a class="item">         item 1     </a>     <a class="item">         item 2     </a>     <a class="item">         item 3     </a> </div>  <div class="pusher">     <div id="map"></div> </div>  <script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script> <script type="text/javascript" src="bower_components/semantic/dist/semantic.min.js"></script> <script type="text/javascript" src="bower_components/leaflet/dist/leaflet.js"></script> <script>     var map = l.map('map').setview([51.505, -0.09], 13);     $('.ui.sidebar').sidebar('toggle'); </script> </body> 

here changes did css:

body { background-color: #ffffff; display: flex; height: 100vh; flex-direction: column; }  #map {     height: 100vh;     width: 100%; } 

an example of how behaving, page loads, , after toggle:

as page loads

after toggle

try this

<body>      <style>    .unstyle{    background: rgba(0,0,0,.0)!important;  }  </style>    <div id="topbar" style="width: 100%; height: 37px;" class="">    <button id="btn"> toggle</button>    <button style="float: right"> toggle</button>  </div>  <div id="app" class="" style="height: 94%; width: 100%">    <div class="ui left vertical menu sidebar unstyle"></div>    <div class="pusher" style="height: 100%; width: 100%;">      <div id="mapid"  style="height: 100%; width: 100%; position: relative;"> </div>    </div>    <script>    $('#app .ui.sidebar')     .sidebar({context: $('#app')})     .sidebar('setting','transition', 'overlay')     .sidebar('setting','dimpage', false)     .sidebar('setting','closable', false)     .sidebar('attach events', '#btn')     .sidebar('toggle');    </script>  </div>    </body>

result screenshot


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -