jquery - Bootstrap - div over div slideup -


i can't head around one: i'm creating mobile webapp bootstrap. have container navbar, divs , again pill-nav below:

<div class="container"> <!-- top navbar -->     <nav class="navbar navbar-default navbar-fixed-top">     <!-- ... -->     </nav>      <div class="tab-content">          <div role="tabpanel" class="tab-pane active fade in" id="map-panel">             <div id="map"></div>               <div class="container-fluid" id="teaser-container">                 <div class="row" id="teaser-slideup-button">                     <div class="col-xs-12">                         <a role="button" href="#teaser-content">                             <i class="fa fa-chevron-up"></i>                         </a>                     </div>                 </div>                 <div class="row" id="teaser-header">                     <div class="col-xs-12">teaser header</div>                 </div>                  <div id="teaser-content">                     <div class="row">                         <div class="col-xs-12">                             <div style="height: 160px" />                         </div>                     </div>                 </div>             </div>                     </div>     </div>      <nav class="navbar navbar-default navbar-fixed-bottom">         <!-- ... -->     </nav>  </div> 

what want let #teaser-container slide on #map below.

$('#teaser-slideup-button').on('click', function (e) {       $('#teaser-container').animate({             'bottom': '0px'      });  }); 

some relevant css:

#teaser-container {     z-index:1000;      position: absolute;     bottom: -100px;     background: #fff;     width: 100%;     display: inline-block;     overflow-y: hidden; }  #map-panel {     position: absolute;     top: 0px;     overflow-y: hidden;     height: 100%;     width: 100%; } 

what happens, though, div appears , seemingly animation takes place afterwards, scrolling map div upwards. i've created jsfiddle here:

https://jsfiddle.net/jrubisch/hvpjrwrq/

this should not hard, guess, i'm sort of confused here... i'd happy provide more details if required.

thanks!

this may or may not help, looks , seems operate in similar fashion uses buttons , accordion.

var map;    function initialize() {    map = new google.maps.map(document.getelementbyid('map-canvas'), {      zoom: 8,      center: {        lat: -34.397,        lng: 150.644      }    });  }    google.maps.event.adddomlistener(window, 'load', initialize);    $('.collapse').on('shown.bs.collapse', function() {    $(this).parent().find(".fa-chevron-up").removeclass("fa-chevron-up").addclass("fa-chevron-down");  }).on('hidden.bs.collapse', function() {    $(this).parent().find(".fa-chevron-down").removeclass("fa-chevron-down").addclass("fa-chevron-up");  });
html,  body,  #map-canvas {    height: 100%;    margin: 0;    padding: 0;  }  .navbar {    margin-bottom: 0 !important;  }  .navbar-fixed-bottom .col-md-6 {    padding: 0;    border: none;  }  .navbar-fixed-bottom .btn {    width: 100%;    height: 50px;    border-radius: 0;    margin: 0;    border: none;    padding-top: 15px;  }  .navbar-fixed-bottom .panel-group,  .navbar-fixed-bottom .panel-heading {    padding: 0;    margin: 0;    border: none;    border-radius: 0;  }
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" />  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />  <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>  <nav class="navbar navbar-default">    <div class="container-fluid">      <!-- brand , toggle grouped better mobile display -->      <div class="navbar-header">        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">toggle navigation</span>  <span class="icon-bar"></span>  <span class="icon-bar"></span>  <span class="icon-bar"></span>         </button>        <a class="navbar-brand" href="#">brand</a>       </div>        <!-- collect nav links, forms, , other content toggling -->      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">        <ul class="nav navbar-nav">          <li class="active"><a href="#">link <span class="sr-only">(current)</span></a>          </li>          <li><a href="#">link</a>          </li>          <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">dropdown <span class="caret"></span></a>            <ul class="dropdown-menu">              <li><a href="#">action</a>              </li>              <li><a href="#">another action</a>              </li>              <li><a href="#">something else here</a>              </li>              <li role="separator" class="divider"></li>              <li><a href="#">separated link</a>              </li>              <li role="separator" class="divider"></li>              <li><a href="#">one more separated link</a>              </li>            </ul>          </li>        </ul>      </div>      <!-- /.navbar-collapse -->    </div>  </nav>  <div id="map-canvas"></div>  <div class="navbar navbar-default navbar-fixed-bottom">    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">      <div class="panel panel-default">        <div class="panel-heading" role="tab" id="headingone">          <div class="btn btn-warning" id="loweropen" type="button" data-toggle="collapse" data-target="#collapseone" aria-expanded="false" aria-controls="collapseone"> <i class="fa fa-chevron-up"></i>           </div>        </div>        <div id="collapseone" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingone">          <div class="panel-body">anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. food truck quinoa nesciunt laborum eiusmod. brunch 3 wolf moon tempor, sunt aliqua            put bird on squid single-origin coffee nulla assumenda shoreditch et. nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. ad vegan excepteur butcher vice lomo. leggings occaecat craft beer farm-to-table,            raw denim aesthetic synth nesciunt haven't heard of them accusamus labore sustainable vhs.</div>        </div>      </div>    </div>    <div class="col-md-6">      <div class="btn btn-primary"><i class="fa fa-map-marker"></i> some</div>    </div>    <div class="col-md-6">      <div class="btn btn-default"><i class="fa fa-sliders"></i> controls</div>    </div>  </div>


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -