iOS下的 Fixed + Input BUG现象

示例代码:

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<meta name="apple-touch-fullscreen" content="YES" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<script src="http://s.thsi.cn/js/m/js/zepto.min.js"></script>
	<title>ios_inputFixedBug</title>
  <style type="text/css">
    *{margin: 0;padding: 0;}
    header{
      position:fixed;/*"高度坍塌":fixed元素的高度会被忽略不计*/
      height: 50px;
      left: 0;
      right: 0;
      top: 0;
    }
    main{
      position: absolute;/* main绝对定位,进行内部滚动 */
      top:50px;
      bottom: 40px;/*防止footer遮挡main内容*/
      overflow-y: scroll;/*使之可以滚动*/
    -webkit-overflow-scrolling: touch;/* 增加该属性,可以增加弹性 */
      background-color: #f1a456;
      width: 100%;
    }
    main .content{
       height: 1000px;
    }
    footer{
      position: fixed;
      height: 40px;
      left: 0;
      right: 0;
      bottom: 0;
    }
    footer input{height: 40px;width: 80%;}
  </style>
</head>
<body>
   <!--fixed定位-->
   <header>头部</header>
   <!-- 可以滚动的区域 -->
   <main>
    <div id="content">
    ss
    </div>
   </main>
   <footer id="send">
     <input type="text" placeholder="请输入内容" style="text-indent: 5px;">
   </footer> 
  <script type="text/javascript">
      var str="";
      for(var i=0; i<100; i++){
        str += "内容区域(可滚动)"+ i + "<br/>";
      }
      $('#content').html(str);
  </script>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值