页:
[1]
| Richie.s | 2004-10-10 04:58 AM |
|
下拉展开的菜单被下面的下拉列表挡住了,怎么办??
下拉展开的菜单被下面的下拉列表挡住了,怎么办??
请帮我看看这是网地址:
http;//pre.epacketware.com/test
请高手帮忙!!:confused: |
|
| 这个问题我也遇到。不过没找到解决办法。只有在排版的时候注意了。。。汗。。。 |
| Richie.s | 2004-10-10 06:48 AM |
|
| 哎,其实是和浏览器有点问题,别的浏览器就可以正常的,在ie下就不行,真受不了! |
|
这个是IE的BUG
[PHP]
function Rect(){
var width=0;
var height=0;
var left=0;
var top=0;
var right=0;
var bottom=0;
}
Rect.prototype.Cal=function () {
this.right=this.left+this.width;
this.bottom=this.top+this.height;
}
Rect.prototype.ContaintPoint=function (x,y){
if(x>=this.left && x<=this.right && y>=this.top && y<=this.bottom) return true;
return false;
}
Rect.prototype.BeCoverBy=function (rectSrc){
return rectSrc.ContaintPoint(this.left,this.top) ||
rectSrc.ContaintPoint(this.left,this.bottom) ||
rectSrc.ContaintPoint(this.right,this.top) ||
rectSrc.ContaintPoint(this.right,this.bottom) ||
this.ContaintPoint(rectSrc.left,rectSrc.top) ||
this.ContaintPoint(rectSrc.right,rectSrc.top) ||
this.ContaintPoint(rectSrc.left,rectSrc.bottom) ||
this.ContaintPoint(rectSrc.right,rectSrc.bottom);
}
function getElementRect(obj){
var e=obj;
var pos=new Rect;
pos.width=obj.offsetWidth;
pos.height=obj.offsetHeight;
pos.left=obj.offsetLeft;
pos.top=obj.offsetTop;
while(e=e.offsetParent){
pos.left+=e.offsetLeft;
pos.top+=e.offsetTop;
}
pos.Cal();
return pos;
}
[/PHP]
这个是Rect,JS文件…………
有用的 |
|
假设你那个菜单层的ID是 divMenu
好了…………看下面两个函数,这个是显示和隐藏菜单的
[PHP]
function ShowMenu(){
var oMenu=document.all('divmenu');
var rMenu=getElementRect(oMenu);
var gSel=document.getElementsByTagName("SELECT");
if(typeof(gSel.length)=='number'){
for(var iCnt=0;iCnt<gSel.length;iCnt++)
if(rMenu.BeCoverBy(getElementRect(gSel[iCnt])))
gSel[iCnt].runtimeStyle.visibility='hidden';
}else{
if(rMenu.BeCoverBy(getElementRect(gSel)))
gSel.runtimeStyle.visibility='hidden';
}
oMenu.runtimeStyle..visibility='visibe';
}
function HideMenu(){
var oMenu=document.all('divmenu');
var rMenu=getElementRect(oMenu);
var gSel=document.getElementsByTagName("SELECT");
if(typeof(gSel.length)=='number'){
for(var iCnt=0;iCnt<gSel.length;iCnt++)
if(gSel[iCnt].runtimeStyle.visibility=='hidden')
gSel[iCnt].runtimeStyle.visibility='visible';
}else{
if(gSel.runtimeStyle.visibility=='hidden')
gSel.runtimeStyle.visibility='visible';
}
oMenu.runtimeStyle..visibility='hidden';
}
[/PHP] |
|
Rect..Js已经测试过了,没问题
下面的代码我没有测试,临时写的,凑合着看吧
还有IFRAME在IE里面也是这样的,处理方法跟SELECT一样 |
|
<param name="wmode" value="transparent">
<param name="wmode" value="Opaque">
加在flash里就好了 |
| MoOnline | 2004-12-22 12:38 PM |
|
| 用css设定层的级别。 |
Powered by Discuz! Archiver 6.1.0
© 2001-2006 Comsenz Inc.
Processed in 1.621094 second(s), 2 queries |