zoukankan      html  css  js  c++  java
  • document.compatMode介绍

    document.compatMode 检查当前的文档渲染模式

    返回值:BackCompat和CSS1Compat;

    IE对两种模式渲染差别很大;

    BackCompat: Standards-compliant mode is not switched on. (Quirks Mode) //默认模式

    CSS1Compat: Standards-compliant mode is switched on. (Standards Mode) //标准模式

    例子:

    alert(document.body.clientWidth + '-' + document.documentElement.clientWidth + '-' + document.compatMode);

    document.body.clientWidth ==> BODY对象宽度
    document.body.clientHeight ==> BODY对象高度
    document.documentElement.clientWidth ==> 可见区域宽度(Quirks Mode不兼容)
    document.documentElement.clientHeight ==> 可见区域高度Quirks Mode不兼容

    IE标准模式下 clientWidth 和 scrollWidth值相同;

  • 相关阅读:
    11111
    单例-Singleton-03
    单例-Singleton-02
    单例-Singleton-01
    load和initialize
    OC中的static-01
    GCD-06
    GCD-05
    GCD-03
    UIView-01
  • 原文地址:https://www.cnblogs.com/kk073000/p/2844391.html
Copyright © 2011-2022 走看看