主要问题:

1,头部输入框固定后,只要再滑动内容的话,输入框会随着滑动内容而滑动。

2,在低端机:2.3以下的安卓机,你会发现怎么解决都不行的,系统浏览器是不会支持的,头部底部固定的话会滑动内容而滑动。

flex模拟fixed(推荐使用)

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>flex模拟fixed</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style>
html,body{
height:100%;
margin:0;
padding:0;
}/**/
.wrap{height:100%;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-flex:1;display:flex;display:-webkit-flex;flex-direction:column;flex:1;-webkit-flex:1;}
.content{display:-webkit-box;-webkit-box-flex:1;flex:1;-webkit-flex:1;display:flex;display:-webkit-flex;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:5px 5px 60px 5px;} header,footer{position:fixed;z-index:1;left:0;right:0;
height:40px;
text-align:center;
width:100%;
line-height:40px;
background:#fff;
}
header{
border-bottom:1px solid #ccc;
}
footer{
border-top:1px solid #ccc;
bottom:0;
}
h1{margin:0; } </style>
</head>
<body>
<div class="wrap">
<header class="">
<h1 class=""><input type="text"/></h1>
</header> <div class="content">
<div class="">
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2><input type="text"/></h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content-last</h2>
</div> </div>
<footer class="">
<input type="text"/>
</footer>
</div> </body>
</html>

absolute模拟fixed

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>absolute模拟fixed</title> <!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"> <!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style>
html,
body{height:100%;margin:0;padding:0;}
header,footer{height:40px; text-align:center; position:absolute; width:100%; line-height:40px; background:#fff; z-index:2;}
header{border-bottom:1px solid #ccc;top:0;}
footer{border-top:1px solid #ccc;bottom:0;}
h1{margin:0; }
.content{position:absolute;top:40px;left:0;right:0;bottom:40px; box-sizing:border-box;overflow-y:auto;-webkit-overflow-scrolling:touch;}
</style>
</head>
<body> <!-- Make sure all your bars are the first things in your <body> -->
<header class="bar bar-nav">
<h1 class="title"><input type="text"/></h1>
</header> <!-- Wrap all non-bar HTML in the .content div (this is actually what scrolls) -->
<div class="content">
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2><input type="text"/></h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content</h2>
<h2>content-last</h2>
</div>
<footer class="bar bar-footer">
<input type="text"/>
</footer>
</body>
</html>

目前还会存在的一些问题,页面第一次点击底部输入法是会挡住输入框的,这个情况我测试IOS8系统的时候会出现,小米1S安卓4.0系统没这个问题。

其实可以把底部高度稍微调高点就行;或是点击输入框的时候来一次刷新就不会有这个问题了。

目前我能提供的也只是这个解决方案了,也适合做头部底部fixed固定。

webapp中fixed问题解决方案的更多相关文章

  1. 谈一谈手机WebApp的fixed属性(手机上的固定栏)【转】

    1.iphone/android原生app常见结构 似乎,所有的手机应用,都遵循这样的布局:固定的顶部+固定的底部+可滚动在中间区域.这种“雷同”的模式让人恶心,却不得不承认这是一种很规矩却又很实用的 ...

  2. IE6浏览器不支持固定定位(position:fixed)解决方案(转)

    IE6浏览器不支持固定定位(position:fixed)解决方案   来源:互联网 作者:佚名 时间:12-04 10:54:05 [大 中 小] 点评:有些朋友在进行网页布局时,会遇到IE6浏览器 ...

  3. Svelte Ui Admin后台管理系统|svelte3+svelteUI中后台前端解决方案

    基于svelte3.x+svelteKit+svelte-ui网页后台管理系统SvelteAdmin. Svelte-Ui-Admin 基于svelte3.x+svelteKit+vite3+echa ...

  4. WebApp中的页面生命周期及路由管理

    最近切换到一个新项目,使用的技术栈是Require+Backbone,鉴于对鞋厂webapp框架的了解,发现这个新项目有些缺陷,主要是单纯依赖Backbone造成的,也就是Backbone的好和坏都在 ...

  5. SQL实现递归及存储过程中In()参数传递解决方案[转]

    SQL实现递归及存储过程中In()参数传递解决方案   1.SQL递归 在SQL Server中,我们可以利用表表达式来实现递归算法,一般用于阻止机构的加载及相关性处理.   -->实现: 假设 ...

  6. SQL Server 2008空间数据应用系列十一:提取MapInfo地图数据中的空间数据解决方案

    原文:SQL Server 2008空间数据应用系列十一:提取MapInfo地图数据中的空间数据解决方案 友情提示,您阅读本篇博文的先决条件如下: 1.本文示例基于Microsoft SQL Serv ...

  7. python解释器的安装;python2与python3同时在环境变量中时的解决方案

    新文档 html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,addres ...

  8. tomcat中session在两个webapp中实现共享

    现在遇到一个需求就是要求完成简单的单点登录,通过在一个tomcat实例中放置两个webapps应用ROOT应用和CEO应用来完成在ROOT应用登录后,在CEO可以直接使用,而未在ROOT应用登录时,不 ...

  9. 负载均衡集群中的session解决方案【转】

    通常面临的问题 从用户端来解释,就是当一个用户第一次访问被负载均衡代理到后端服务器A并登录后,服务器A上保留了用户的登录信息:当用户再次发送请求时, 根据负载均衡策略可能被代理到后端不同的服务器,例如 ...

随机推荐

  1. 【bzoj1408】 Noi2002—Robot

    http://www.lydsy.com/JudgeOnline/problem.php?id=1408 (题目链接) 题意 定义了3种数,分别求这3种数的φ的和,其中φ(1)=0. Solution ...

  2. Android成长日记-APP的签名和打包

    签名的意义: 1. 为了保证每个应用程序开发者的合法 2. 防止部分人通过使用相同的Package Name来混淆替换已经安装的程序,从而出现一些恶意篡改 3. 保证我们每次发布的版本的一致性 (如自 ...

  3. centos虚拟机克隆

    vmware vsphere平台上克隆centos6 一.删掉/etc/udev/rules.d/70-persistent-net.rules文件 reboot 二.vim ifcfg-eth0 删 ...

  4. python pep8

    有这个自动的规范检查工具 pip install pep8 具体使用不说了 ==. 百度一堆  http://blog.sae.sina.com.cn/archives/4781  看这里

  5. python编码

    一.编码 常见的编码比较: ascii:1个字节 unicode:2个字节 utf-8:英文1个字节,汉字3个字节 二.一个编码问题 问:如下代码设置了在代码中添加了coding: utf-8,但是在 ...

  6. spring+hibernate ---laobai

    biz包: package com.etc.biz; import java.util.List; import org.springframework.orm.hibernate3.support. ...

  7. jquery selector 基础

    转自:http://www.cnblogs.com/zwl12549/archive/2008/08/09/1264163.html query的这套选择符是比较帅气的,借用了XPath2.0和CSS ...

  8. 最近在 OS-10.9下配置opencv, cgal, latex, qt, pillow

    其实我之前使用的Mac os的版本是10.8的雪豹,可是最近想体验一下Mac os10.9新版本,于是就开始更新Mac os,经过10多个小时的下载和成功安装后,发现之前的配置全乱了,首先是发现lat ...

  9. Oracle 的表备份的方法

    1.直接备份(防止误操作后数据库表不能恢复) create table new_table as select * from old_table; 2.创建表头,然后插入列(繁琐的做法) create ...

  10. centos 6.4 系统代理上网 设置

    前面讲了yum 代理设置上网的方法,现在设置一下系统代理上网, 网上很多都不管用,已亲测管用 [root@proxy ~]# cat .bash_profile #root目下添加代理上网,蓝色代码# ...