IE浏览器不同版本获取屏幕高度

/**
 * 根据浏览器获取高度
 * @author ywy
 * @date 2020-08-19
 */
function getHeight(){
  if (userAgent.indexOf("compatible") > -1 && userAgent.replace(/[ ]/g,"").indexOf("MSIE8.0") > -1) {
    return window.innerHeight||(document.documentElement&&document.documentElement.clientHeight)||document.body.clientHeight;
  }else{
    return jQuery(window).height();
  }
}

调用这个方法赋值高度即可,如:

var ch = getHeight();
原文地址:https://www.cnblogs.com/ywy8/p/13528764.html