我正在使用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。 我怎样才能做到这一点。
答案 0 :(得分: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>