以下代码在IE8下没问题,用IE8兼容视图也没问题,可在IE6下,和IETester所有版本下都有问题问题是:弹出了层,框架没有加载外部网页。另外想在外部网页未加载之前希望能显示:网页加载中……<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>list</title>
<script>
var iss=0;
var ig,wb;
var W=600,H=400;
function A(url){
document.getElementById("container").style.display="none";
if(iss==0){
var Bind = function(object, fun) {
return function() {
return fun.apply(object, arguments);
}
}
wb = document.createElement("div");
with(wb.style){
position = 'absolute';
wb._resize = Bind(wb, function(){
zIndex = '10000';
width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) + "px";
height =Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px";
position="absolute";
left = '0';
top = '0';
background = '#000000';
filter = 'Alpha(opacity=70)';
opacity = '0.7';
});
wb._resize();
if(document.all){
window.attachEvent("onresize", wb._resize);
}
else{
window.addEventListener("onresize", wb._resize,false);
}
}
ig = document.createElement("div");
with(ig.style){
width=W+"px";
height=H+"px";
position = 'absolute';
zIndex = '10001';
left = '50%';
top = '50%';
marginLeft = - (W+10) / 2 + 'px';
marginTop = - (H+10) / 2 + 'px';
border = '1px solid #999999';
padding='4px'
background='#FFFFFF'
}
ig.innerHTML='<iframe src="'+url+'" frameborder="0" scrolling="no" height="'+H+'" width="'+W+'"></iframe>';
}
else{
ig.innerHTML='<iframe src="'+url+'" frameborder="0" scrolling="no" height="'+H+'" width="'+W+'"></iframe>';
ig.style.display="inline";
wb.style.display="inline";
}
wb.onclick = function(){bc()}
function bc(){
document.getElementById("container").style.display="";
ig.style.display="none";
wb.style.display="none";
}
document.body.appendChild(ig);
document.body.appendChild(wb);
iss=1;
}
</script>
</head><body>
<div id="container">
<a href="javascript:;" onclick="A('http://www.baidu.com');">点击我看看11111</a><br><br>
<a href="javascript:;" onclick="A('http://www.google.com');">点击我看看22222</a>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>list</title>
<script>
var iss=0;
var ig,wb;
var W=600,H=400;
function A(url){
document.getElementById("container").style.display="none";
if(iss==0){
var Bind = function(object, fun) {
return function() {
return fun.apply(object, arguments);
}
}
wb = document.createElement("div");
with(wb.style){
position = 'absolute';
wb._resize = Bind(wb, function(){
zIndex = '10000';
width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) + "px";
height =Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px";
position="absolute";
left = '0';
top = '0';
background = '#000000';
filter = 'Alpha(opacity=70)';
opacity = '0.7';
});
wb._resize();
if(document.all){
window.attachEvent("onresize", wb._resize);
}
else{
window.addEventListener("onresize", wb._resize,false);
}
}
ig = document.createElement("div");
with(ig.style){
width=W+"px";
height=H+"px";
position = 'absolute';
zIndex = '10001';
left = '50%';
top = '50%';
marginLeft = - (W+10) / 2 + 'px';
marginTop = - (H+10) / 2 + 'px';
border = '1px solid #999999';
padding='4px'
background='#FFFFFF'
}
ig.innerHTML='<iframe src="'+url+'" frameborder="0" scrolling="no" height="'+H+'" width="'+W+'"></iframe>';
}
else{
ig.innerHTML='<iframe src="'+url+'" frameborder="0" scrolling="no" height="'+H+'" width="'+W+'"></iframe>';
ig.style.display="inline";
wb.style.display="inline";
}
wb.onclick = function(){bc()}
function bc(){
document.getElementById("container").style.display="";
ig.style.display="none";
wb.style.display="none";
}
document.body.appendChild(ig);
document.body.appendChild(wb);
iss=1;
}
</script>
</head><body>
<div id="container">
<a href="javascript:;" onclick="A('http://www.baidu.com');">点击我看看11111</a><br><br>
<a href="javascript:;" onclick="A('http://www.google.com');">点击我看看22222</a>
</div>
</body>
</html>
解决方案 »
- 懂Javascript的进来看,帮我加下实现链接跳转
- return function()的作用??
- RMB求帮忙改个JS轮播图片代码的尺寸(已经在猪八戒网发布)
- 如何清除JS动态创建的DIV?
- 求js实现table旋转代码
- 急问题,请帮帮忙!分不够可以再给,送Q币做回报也行!
- 请高手帮我看一下,谢谢
- 怎么刷新别的框架页包含的iframe
- 请问,在JScript中如何统计中文字符的实际长度。(JScript有没有内部支持的函数)
- juqery定时器的问题,帮忙分析下。
- 倒时计的JS,为什么计算不出月大呢?比如8月有31天?
- 请问一个网站的body中使用了oncopy="return false",可以用什么办法处理一下,让我可以复制内容呀?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>list</title>
<script>
var iss=0;
var ig,wb;
var W=600,H=400;
function A(url){
document.getElementById("container").style.display="none";
if(iss==0){
var Bind = function(object, fun) {
return function() {
return fun.apply(object, arguments);
}
}
wb = document.createElement("div");
with(wb.style){
position = 'absolute';
wb._resize = Bind(wb, function(){
zIndex = '10000';
width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) + "px";
height =Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px";
position="absolute";
left = '0';
top = '0';
background = '#000000';
filter = 'Alpha(opacity=70)';
opacity = '0.7';
});
wb._resize();
if(document.all){
window.attachEvent("onresize", wb._resize);
}
else{
window.addEventListener("onresize", wb._resize,false);
}
}
ig = document.createElement("div");
with(ig.style){
width=W+"px";
height=H+"px";
position = 'absolute';
zIndex = '10001';
left = '50%';
top = '50%';
marginLeft = - (W+10) / 2 + 'px';
marginTop = - (H+10) / 2 + 'px';
border = '1px solid #999999';
padding='4px'
background='#FFFFFF'
}
ig.innerHTML='<iframe src="" id="ifr_url" frameborder="0" scrolling="no" height="'+H+'" width="'+W+'"></iframe>';
}
else{
ig.innerHTML='<iframe src="" id="ifr_url" frameborder="0" scrolling="no" height="'+H+'" width="'+W+'"></iframe>';
ig.style.display="inline";
wb.style.display="inline";
}
wb.onclick = function(){bc()}
function bc(){
document.getElementById("container").style.display="";
ig.style.display="none";
wb.style.display="none";
}
document.body.appendChild(ig);
document.body.appendChild(wb);
iss=1;
document.getElementById('ifr_url').src=url;
}
</script>
</head><body>
<div id="container">
<a href="javascript:;" onclick="A('http://www.baidu.com');">点击我看看11111</a><br><br>
<a href="javascript:;" onclick="A('http://www.google.com');">点击我看看22222</a>
</div>
</body>
</html>