-1

fancybox 2 youtube iframe を使用するページがあります。IE9 以外のすべてのブラウザーで完全に動作し、何が起こっているのかわかりません。IE9 では何も起こりません。ポップアップもオーバーレイもまったくありません。IE8 と IE7 は正常に動作し、Safari、Chrome、Firefox はすべて問題ありません。

このページは最初の行の doctype から始まります - 他に IE9 に特有のチェックすべき点はありますか?

ありがとう!

4

1 に答える 1

1

IE7 と IE8 で動作している場合は、それらが使用されているときにページが互換モードで表示されているかどうかを確認します。そうでない場合は、IE9 が強制的に互換モードになっている可能性があります。メタ タグを指定することで、IE で標準モードを強制できます。

    <meta http-equiv="X-UA-Compatible" content="IE=edge" >

JavaScript を使用して、IE がどのモードで表示されているかを判断することもできます。

    javascript:alert(document.documentMode);

    <script type="text/javascript">
    engine = null;
if (window.navigator.appName == "Microsoft Internet Explorer")
{
   // This is an IE browser. What mode is the engine in?
   if (document.documentMode) // IE8 or later
      engine = document.documentMode;
   else // IE 5-7
   {
      engine = 5; // Assume quirks mode unless proven otherwise
      if (document.compatMode)
      {
         if (document.compatMode == "CSS1Compat")
            engine = 7; // standards mode
      }
      // There is no test for IE6 standards mode because that mode  
      // was replaced by IE7 standards mode; there is no emulation.
   }
   // the engine variable now contains the document compatibility mode.
}
</script>

または、IE を特定のバージョンとして表示するように強制することもできます。

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

Microsoft には、これについて詳しく説明している優れた MSDN 記事があります。http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

于 2012-09-07T18:50:34.673 に答える