搜索
您的当前位置:首页正文

document.compatMode标准兼容模式判断

来源:哗拓教育
if  == “BackCompat”) {
   cWidth = document.body.clientWidth;
   cHeight = document.body.clientHeight;
   sWidth = document.body.scrollWidth;
   sHeight = document.body.scrollHeight;
   sLeft = document.body.scrollLeft;
   sTop = document.body.scrollTop;
}else {
  == “CSS1Compat”
   cWidth = document.documentElement.clientWidth;
   cHeight = document.documentElement.clientHeight;
   sWidth = document.documentElement.scrollWidth;
   sHeight = document.documentElement.scrollHeight;
   sLeft = document.documentElement.scrollLeft == 0 ? document.body.scrollLeft :   document.documentElement.scrollLeft;
   sTop = document.documentElement.scrollTop == 0 ? document.body.scrollTop : document.documentElement.scrollTop;
}
Top