ios上position:fixed失效問題

手機端上的貓膩真是多啊~~~ 此起彼伏!css

最近又遇到了 固定定位的底部導航在ios上被彈出去html

此時心裏1w+個草泥馬奔過~~~~~~~~ios

 

直接上解決方案:web

<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去解決,達到理想中的效果。htm

在ios上表現順暢,在安卓上略顯卡頓。不知道是否還有更好的解決辦法~blog

相關文章
相關標籤/搜索