0

我正在使用谷歌的默认 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

好的,我明白了:我需要将模式设置为“叠加”:这有一个缺点:刷新页面后对话框不会重新出现。

<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 回答