转自:http://blog.youkuaiyun.com/dengboblog/article/details/52605416?locationNum=4&fps=1
js|虚拟键盘挡住input标签
- if(/Android [4-6]/.test(navigator.appVersion)) {
- window.addEventListener("resize", function() {
- if(document.activeElement.tagName=="INPUT" || document.activeElement.tagName=="TEXTAREA") {
-
- window.setTimeout(function() {
- document.activeElement.scrollIntoViewIfNeeded();
- },0);
- }
- })
- }
不过底部有个fixed 元素
-
- document.write( '<style>.float-bottom{visibility:hidden}@media(min-height:' + ($( window ).height() - 10) + 'px){.float-bottom{visibility:visible}}</style>' );