日期:2014-05-16  浏览次数:20340 次

@@@@@用DIV仿制模式对话框的问题@@@@@
我用javascript创建了一个类似模式对话框的div,   在IE7,和   FireFox下,原页面的控件都能被覆盖,无法使用.直到该DIV删除后才可使用.
但是在IE6中,div只能覆盖文本字体和   disabled的控件,普通控件仍然能使用请问这个是什么原因,
如何解决。

起初我以为是我的div中动态创建的控件的问题,后来发现,纯粹创建div也是这样.
谢谢

------解决方案--------------------
你弄个半透明的DIV把下面页面全遮盖住不就可以了?
------解决方案--------------------
以前网上搜的,忘了地址了:
<!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>
<style type= "text/css ">

#id1{width:100%;height:100%;background-color:#000;position:absolute;top:0;left:0;z-index:49;display:none;}
#id2{top:200px;position:absolute;z-index:50;display:none;border:3px solid #E5E5E5; left:100px;background-color:white;}
</style>
<meta http-equiv= "Content-Type " content= "text/html; charset=utf-8 " />
<title> asfsdfasdfasdf </title>
<script language= "javascript " type= "text/javascript ">
function show(){
id1.style.height=window.screen.height+ "px ";
id1.style.width=window.screen.width+ "px ";
id1.style.display= 'block ';
id2.style.display= 'block '
}
function hide(){
id1.style.display= 'none '
id2.style.display= 'none '
}
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.id2.style.pixelTop += percent;
if(NS) document.id2.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.id2.style.pixelLeft += percent;
if(NS) document.id2.left += percent;
lastScrollX = lastScrollX + percent;
}
}
<!-- /STALKER CODE -->
<!-- DRAG DROP CODE -->
function checkFocus(x,y) {
stalkerx = document.id2.pageX;
stalkery = document.id2.pageY;
stalkerwidth = document.id2.clip.width;
stalkerheight = document.id2.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false;
}
function grabIt(e) {
if(IE) {
whichIt = event.srcElement;
while (whichI