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上表現順暢,在安卓上略顯卡頓。不知道是否還有更好的解決辦法~

 

 

 

 

 

 

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM