我想在弹出窗口中显示地图,但在IE6,IE7下地图都跑出窗口外面去,悬浮起来,请高手指点指点,谢谢,以下是全部代码html代码<!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>无标题文档</title>
<script language="javascript" src="jquery-1.7.min.js"></script>
<script language="javascript" src="popup.js"></script>
<script src="http://api.map.baidu.com/api?v=1.3" type="text/javascript" id="mapjs"></script>
<link type="text/css" rel="stylesheet" href="general.css" /></head><body>
<input type="button" onclick="loadPopup()"  value="显示弹出层"/>
<div id='popupContact'>
<div id='container'>
<div id='close'><a id='popupContactClose' onclick='disablePopup()'>x</a></div>
<div id='popupContent'>
<div id="baidumap" style="height:800px; width:100%;"></div>
<script language="javascript">
var mcontent="sadfadf";
var upoint = new BMap.Point(116.404, 39.915);
var map = new BMap.Map("baidumap");
map.addControl(new BMap.NavigationControl());
            map.centerAndZoom(upoint,16);
            var uer = new BMap.Marker(upoint);
            map.addOverlay(uer);
            var uinfowindow = new BMap.InfoWindow(mcontent);
            uer.openInfoWindow(uinfowindow);
            uer.addEventListener("click", function(){    
            this.openInfoWindow(uinfowindow);
            });
</script>
</div>
</div>
</div>
<div id='backgroundPopup' onclick='disablePopup()'></div>
</body>
</html>
js代码/***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: [email protected]
//@license: Feel free to use it, but keep this credits please!
/***************************///SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatus = 0;//loading popup with jQuery magic!
function loadPopup(){
//loads popup only if it is disabled
if(popupStatus==0){
$("#backgroundPopup").css({
"opacity": "0.7"
});
$("#backgroundPopup").fadeIn("slow");
$("#popupContact").fadeIn("slow");
popupStatus = 1;
}
}//disabling popup with jQuery magic!
function disablePopup(){
//disables popup only if it is enabled
if(popupStatus==1){
$("#backgroundPopup").fadeOut("slow");
$("#popupContact").fadeOut("slow");
popupStatus = 0;
}
}//centering popup
function centerPopup(){
//request data for centering
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#popupContact").height();
var popupWidth = $("#popupContact").width();
//centering
$("#popupContact").css({
"position": "absolute",
"top": windowHeight/2-popupHeight/2,
"left": windowWidth/2-popupWidth/2
});
//only need force for IE6

$("#backgroundPopup").css({
"height": document.body.clientHeight,
"width" : document.body.clientWidth
});

}
//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){

//LOADING POPUP
//Click the button event!
//$("#button").click(function(){
//centering with css
//centerPopup();
//load popup
//loadPopup();
//});

//CLOSING POPUP
//Click the x event!
$("#popupContactClose").click(function(){
disablePopup();
});
//Click out event!
$("#backgroundPopup").click(function(){
disablePopup();
});
//Press Escape event!
$(document).keypress(function(e){
if(e.keyCode==27 && popupStatus==1){
disablePopup();
}
});});
CSS代码
@charset "utf-8";
body{font-size:12px;word-break: break-all;}
ul,li{ list-style:none; padding:0; margin:0;}
a{ cursor:pointer;}
#backgroundPopup{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
height:100%;
width:100%;
top:0;
left:0;
background:#000000;
border:1px solid #cecece;
z-index:1;
}
#popupContact{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
height:510px;
width:619px;
border:10px solid #f3f3f3;
border-bottom-width:20px;
z-index:2;
border-top:none;
}
#popupContactClose{}#close{height:20px;
line-height:20px;background:#f3f3f3;overflow:hidden;
text-align:right; font-size:20px;}
#container{}
#popupContent{ background:#FFF; padding:10px; overflow-y:scroll; height:470px;}