这一段代码可以吗?<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head><body>
<SCRIPT language=javascript>
var IE5=(document.getElementById && document.all)? true : false;
var W3C=(document.getElementById)? true: false;
var currIDb=null, currIDs=null, xoff=0, yoff=0; zctr=0; totz=0;function trackmouse(evt){
if((currIDb!=null) && (currIDs!=null)){
var x=(IE5)? event.clientX+document.body.scrollLeft : evt.pageX;
var y=(IE5)? event.clientY+document.body.scrollTop : evt.pageY;
currIDb.style.left=x+xoff+'px';
currIDs.style.left=x+xoff+10+'px';
currIDb.style.top=y+yoff+'px';
currIDs.style.top=y+yoff+10+'px';
return false;
}}function stopdrag(){
currIDb=null;
currIDs=null;
NS6bugfix();
}function grab_id(evt){
xoff=parseInt(this.IDb.style.left)-((IE5)? event.clientX+document.body.scrollLeft : evt.pageX);
yoff=parseInt(this.IDb.style.top)-((IE5)? event.clientY+document.body.scrollTop : evt.pageY);
currIDb=this.IDb;
currIDs=this.IDs;
}function NS6bugfix(){
if(!IE5){
self.resizeBy(0,1);
self.resizeBy(0,-1);
}}function incrzindex(){
zctr=zctr+2;
this.subb.style.zIndex=zctr;
this.subs.style.zIndex=zctr-1;
}function createPopup(id, title, width, height, x , y , isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily ){
if(W3C){
zctr+=2;
totz=zctr;
var txt='';
txt+='<div id="'+id+'_s" style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=50); visibility:visible"> </div>';
txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+height+'px; background-color:'+boxcolor+'; visibility:visible">';
txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+(IE5? width-4 : width)+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'"> '+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\''+id+'_s\').style.display=\'none\'; document.getElementById(\''+id+'_b\').style.display=\'none\';return false"><img src="006/closeb.gif" border="0" height="15" width="15"></a></td></tr></table></div>';
txt+='<div id="'+id+'_ov" width:'+width+'px; style="margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+';">'+text+'</div></div>';
document.write(txt);
this.IDh=document.getElementById(id+'_h');
this.IDh.IDb=document.getElementById(id+'_b');
this.IDh.IDs=document.getElementById(id+'_s');
this.IDh.IDb.subs=this.IDh.IDs;
this.IDh.IDb.subb=this.IDh.IDb;
this.IDh.IDb.IDov=document.getElementById(id+'_ov');
if(IE5){
this.IDh.IDb.IDov.style.width=width-6;
this.IDh.IDb.IDov.style.height=height-22;
this.IDh.IDb.IDov.style.scrollbarBaseColor=boxcolor;
this.IDh.IDb.IDov.style.overflow="auto";
}else{
this.IDh.IDs.style.MozOpacity=.5;
}
this.IDh.IDb.onmousedown=incrzindex;
if(isdraggable){
this.IDh.onmousedown=grab_id;
this.IDh.onmouseup=stopdrag;
}}}if(W3C)document.onmousemove=trackmouse;
if(!IE5 && W3C)window.onload=NS6bugfix;
</SCRIPT>
<SCRIPT language=javascript>
createPopup( '窗口一', '窗口一' ,  220, 120, 400, 180, true, '#cccccc' , '33ff33' , 'black' ,  '欢迎光临JavaScript Fairyland,' , 'white' , 12 , 'sans-serif');
createPopup( '窗口二', '窗口二' ,  220, 120, 100, 180, true, '#cccccc' , '33ff33' , 'black' ,  '欢迎光临JavaScript Fairyland,' , 'white' , 12 , 'arial');
</SCRIPT>
</body></html>

解决方案 »

  1.   

    看看这代码:自己再改改
    <html>
    <head>
    <title>无标题文档</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body bgcolor="#FFFFFF" text="#000000">
    <SCRIPT> 
    var imagepath="http://www.ahui.net/indeximages/logo1.gif"
    var imagewidth=88
    var imageheight=31var speed=3; 
    var imageclick="http://www.ahui.net/" 
    var hideafter=0 var isie=0; 
    if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) { 
    isie=1; 

    else { 
    isie=0; 
    } if(isie){ 
    var preloadit=new Image() 
    preloadit.src=imagepath 

    function pop() { 
    if(isie) { 
    x=x+dx;y=y+dy; 
    oPopup.show(x, y, imagewidth, imageheight); 
    if(x+imagewidth+5>screen.width) dx=-dx; 
    if(y+imageheight+5>screen.height) dy=-dy; 
    if(x<0) dx=-dx; 
    if(y<0) dy=-dy; 
    startani=setTimeout("pop();",50); 

    } function dismisspopup(){ 
    clearTimeout(startani) 
    oPopup.hide() 
    } function dowhat(){ 
    if (imageclick=="dismiss") 
    dismisspopup() 
    else 
    window.open(imageclick);

    if(isie) { 
    var x=0,y=0,dx=speed,dy=speed; 
    var oPopup = window.createPopup(); 
    var oPopupBody = oPopup.document.body; 
    oPopupBody.style.cursor="hand" 
    oPopupBody.innerHTML = '<IMG SRC="'+preloadit.src+'">'; 
    oPopup.document.body.onmouseover=new Function("clearTimeout(startani)") 
    oPopup.document.body.onmouseout=pop 
    oPopup.document.body.onclick=dowhat 
    pop(); if (hideafter>0) 
    setTimeout("dismisspopup()",hideafter*1000) 

    </SCRIPT> 
    </body>
    </html>
      

  2.   

    但是那样的话,div在框架下面无论你把z-index改成什么样
      

  3.   

    我想讓div在iframe上面﹐后面發現ie5.0不行,ie5.5自己就上去了﹗
      

  4.   

    这个问题如果非要把一个DIV浮在Frame上那很难。可是换个思路就容易了。举个例子:有两个DIV,一个在左边的Frame里,一个在右边的Frame里。两个都是200宽的。如果左边Frame的DIV靠右侧被遮住100宽,而右边Frame的DIV靠左边被遮住100宽。那看起来就好似一个DIV浮在两个Frame上面。
      

  5.   

    这个很难办到,同样。div也不能浮动在select框、activeX控件上面。微软首页的下拉菜单(div)碰到select的时候也就是把选择框隐藏掉而已