ios上position:fixed失效问题

手机端上的猫腻真是多啊~~~ 此起彼伏!

最近又遇到了 固定定位的底部导航在ios上被弹出去

此时内心1w+个草泥马奔过~~~~~~~~

 

直接上解决方案:

<div class="main_comment">```````````````````</div>
<div class="commentBar">回复框</div>
.main_comment{
  width: 100%;
  position: absolute;
  overflow-y: auto;
  top: 0;
  bottom: 0;
  -webkit-overflow-scrolling: touch;   /*这句是为了滑动更顺畅*/
}
.commentBar{
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  background: #fff;
  padding: 5px;
  z-index: 99;
}

 

这里都是用了absolute去解决,达到理想中的效果。

在ios上表现顺畅,在安卓上略显卡顿。不知道是否还有更好的解决办法~

 

 

 

 

 

 

  

posted @ 2016-07-31 14:06  背对太阳的向日葵  Views(15445)  Comments(0Edit  收藏  举报