我正在尝试构建一个网页,该网页由首次查看网站时激活的覆盖框组成。然后访问者点击覆盖框上的关闭并查看网站的其余部分。
我在firefox中的功能完美无缺。但在iexplorer中,它会导致iexplorer出现以下错误: - “Internet Explorer阻止此页面运行脚本或ActiveX控件。”
如何修改它以便iexplorer不会出现此错误,并正确加载页面。
这是html: -
<html lang="en">
<head>
<script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
<style>
#facebox {
/* overlay is hidden before loading */
display:none;
/* standard decorations */
width:400px;
border:10px solid #666;
/* for modern browsers use semi-transparent color on the border. nice! */
border:10px solid rgba(82, 82, 82, 0.698);
/* hot CSS3 features for mozilla and webkit-based browsers (rounded borders) */
-moz-border-radius:8px;
-webkit-border-radius:8px;
}
#facebox div {
padding:10px;
border:1px solid #3B5998;
background-color:#fff;
font-family:"lucida grande",tahoma,verdana,arial,sans-serif
}
#facebox h2 {
margin:-11px;
margin-bottom:0px;
color:#fff;
background-color:#6D84B4;
padding:5px 10px;
border:1px solid #3B5998;
font-size:20px;
}
</style>
</head>
<body>
<div class="main-content">
<!-- Your Content Here -->
<p>Content</p>
</div>
<!-- facebook dialog -->
<div id="facebox">
<div>
<h2>Facebox</h2>
<p>
This dialog is opened programmatically when the page
loads. There is no need for a trigger element.
</p>
<form>
<input type="file" />
</form>
<p style="color:#666">
To close, click the Close button or hit the ESC key.
</p>
<!-- yes/no buttons -->
<p>
<button class="close"> Close </button>
</p>
</div>
</div>
<script>
$(document).ready(function() {
$("#open_now").click(function() {
$("#facebox").overlay().load();
});
// select the overlay element - and "make it an overlay"
$("#facebox").overlay({
// custom top position
top: 60,
// some mask tweaks suitable for facebox-looking dialogs
mask: {
// you might also consider a "transparent" color for the mask
color: '#000',
// load mask a little faster
loadSpeed: 200,
// very transparent
opacity: 0.5
},
// disable this for modal dialog-type of overlays
closeOnClick: false,
// load it immediately after the construction
load: true
});
});
</script>
</body>
</html>
答案 0 :(得分:0)
仅在本地运行项目时才会出现此问题。如果将项目上传到服务器并显示页面,则不应出现此错误。