鼠标激发图片显示事件:如何让图片显示在最顶层?
我想做一个地图链接,上面是各地的子网页链接,但随着地方变多,小地图上就会显的很拥挤,于是我就想换一张大的地图,但一开始规划的主页划分给地图的空间有限,就想到了用鼠标移动来激发这个事件,但显示出现了问题,请各位帮忙看一下。单页面测试前显示小地图:
" border="0" />
将鼠标移动到小地图上后显示大地图,此时正常显示
" border="0" />
部署到主页后显示大小
" border="0" />
鼠标移动到小地图上后的显示,只显示了大地图的一个角
" border="0" />
有人告诉我说这个是windows层和document层的区别,但我不知道是什么意思,主页是用iframe框来划定各页面大小的
scirpt程序如下:
<SCRIPT language=JavaScript type=text/JavaScript>
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}</SCRIPT>
两处调用如下:
<DIV id=map2 onmouseover="MM_showHideLayers('map2','','show')"
style="Z-INDEX: 1; LEFT: 5px; VISIBILITY: hidden; WIDTH: 0px; POSITION: absolute; TOP: -14px; HEIGHT: 0px"
onmouseout="MM_showHideLayers('map2','','hide')">
-------------------------------------------------------------------------------------------------------
<A onmouseover="MM_showHideLayers('map2','','show')"
onclick='javascript:openout("map.htm")'
onmouseout="MM_showHideLayers('map2','','hide')"> <IMG style="CURSOR: hand" alt="" src="map.gif" border=0></A></TD>