0

Google のデフォルトの CFInstall スクリプトを使用しています (いくつかの小さな変更を加えています)。

<style>
 .chromeFrameInstallDefaultStyle {
   width: 80%; /* default is 800px */
   border: 5px solid blue;
   position: absolute;
   left: 40%;
   z-index: 1000;
 }
</style>

<div id="prompt">
 <!-- if IE without GCF, prompt goes here -->
</div>

<script>
 // The conditional ensures that this code will only execute in IE,
 // Therefore we can use the IE-specific attachEvent without worry
 window.attachEvent("onload", function() {
   CFInstall.check({
     mode: "inline", // the default
     node: "prompt"
   });
 });
</script>

これにより、IE8 以下のユーザーは Chrome Frame をインストールするよう求められます。ただし、ユーザーは iFrame をキャンセルまたは閉じることはできません。どうすればこれを達成できますか。

4

1 に答える 1

0

OK、わかりました。モードを「オーバーレイ」に設定する必要があります。これには1つの欠点があります。ページを更新した後、ダイアログが再表示されないことです。

<style>
 .chromeFrameInstallDefaultStyle {
   width: 80%; /* default is 800px */
   border: 5px solid blue;
   position: absolute;
   left: 40%;
   z-index: 1000;
 }
</style>

<div id="prompt">
 <!-- if IE without GCF, prompt goes here -->
</div>

<script>
 // The conditional ensures that this code will only execute in IE,
 // Therefore we can use the IE-specific attachEvent without worry
 window.attachEvent("onload", function() {
   CFInstall.check({
     mode: "overlay", // "inline" = the default
     node: "prompt"
   });
 });
</script>

于 2012-06-05T12:11:18.993 に答える