中间部分做成可滚动的
var h = document.body.scrollHeight; window.onresize = function(){ if (document.body.scrollHeight < h) { document.getElementsByTagName("nav")[0].style.display = "none"; }else{ document.getElementsByTagName("nav")[0].style.display = "block"; } };
<meta name="viewport" id="viewportMeta">
var initViewport = function(height){
var metaEl = document.querySelector("#viewportMeta"); var content = "height=" + height + ",width=device-width,initial-scale=1.0,user-scalable=no"; metaEl.setAttribute('name', 'viewport'); metaEl.setAttribute('content', content);
}var realHeight = window.innerWidth > window.innerHeight ? window.innerWidth : window.innerHeightinitViewport(realHeight);
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(3)
中间部分做成可滚动的
<meta name="viewport" id="viewportMeta">
var initViewport = function(height){
}
var realHeight = window.innerWidth > window.innerHeight ? window.innerWidth : window.innerHeight
initViewport(realHeight);