工作需要,一时间用min-height或者height:100%加overflow:hidden设置单屏充满全部空间但都没能达到想要的效果,就干脆使用js算了,虽然可能会稍微影响点性能,但总归为一个办法就记一下吧,挺简单的。
例:
var clientH=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var clientW=window.innerWeight || document.documentElement.clientHeight || document.body.clientWeight;