Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More Netscape/IE Layers stuff...

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
CA
Hi Folks

I have the following code:

Code:
<head>
        <title>Consulting</title>
        <style>
        #welcomelayer {position:absolute; left:7px; top:115px; width:170px; height:210px; z-index:1}
        </style>
</head>

<body background=&quot;images/background.gif&quot;>
<div id=&quot;welcomelayer&quot;>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr>
      <td> </td>
    </tr>
    <tr>
      <td>
        <div align=&quot;right&quot;><img src=&quot;images/welcome.gif&quot; width=&quot;110&quot; height=&quot;22&quot;></div>
      </td>
    </tr>
    <tr>
      <td> </td>
    </tr>
    <tr>
      <td align=&quot;right&quot;>
          
          <font face=&quot;verdana&quot; size=&quot;-2&quot;>Thursday, December 20</font>
          </td>
    </tr>
  </table>
</div>

<style>
#topbar {position:absolute; left:0px; top:0px; z-index:1}
</style>
<script language=&quot;JavaScript&quot;>

<!--
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(&quot;#&quot;)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>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); 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];}
}

MM_preloadImages('images/top-bar_03_on.gif','images/top-bar_04_on.gif','images/top-bar_05_on.gif','images/top-bar_06_on.gif','images/top-bar_07_on.gif')
//-->

</script>

<div id=&quot;topbar&quot;>
  <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor=&quot;#c0c0c0&quot;>
    <TR>
                <TD>
                        <IMG SRC=&quot;images/spacer.gif&quot; WIDTH=108 HEIGHT=1></TD>
                <TD>
                        <IMG SRC=&quot;images/spacer.gif&quot; WIDTH=109 HEIGHT=1></TD>
                <TD>
                        <IMG SRC=&quot;images/spacer.gif&quot; WIDTH=34 HEIGHT=1></TD>
                <TD>
                        <IMG SRC=&quot;images/spacer.gif&quot; WIDTH=73 HEIGHT=1></TD>
                <TD>
                        <IMG SRC=&quot;images/spacer.gif&quot; WIDTH=108 HEIGHT=1></TD>
                <TD>
                        <IMG SRC=&quot;images/spacer.gif&quot; WIDTH=108 HEIGHT=1></TD>
                <TD>
                        <IMG SRC=&quot;images/spacer.gif&quot; WIDTH=484 HEIGHT=1></TD>
        </TR>
        <TR>
                
      <TD COLSPAN=3> <a href=&quot;../index.html&quot;><IMG SRC=&quot;images/top-bar_01.gif&quot; WIDTH=251 HEIGHT=53 border=&quot;0&quot; alt=&quot;Home Page&quot;></a></TD>
                <TD COLSPAN=4>
                        <IMG SRC=&quot;images/top-bar_02.gif&quot; WIDTH=773 HEIGHT=53></TD>
        </TR>
        <TR>
        
      <TD> <a href=&quot;expertise.asp&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('expertise','','images/top-bar_03_on.gif',1)&quot;><IMG SRC=&quot;images/top-bar_03.gif&quot; WIDTH=108 HEIGHT=30 name=&quot;expertise&quot; border=&quot;0&quot;></a></TD>
                
      <TD> <a href=&quot;people.asp&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('people','','images/top-bar_04_on.gif',1)&quot;><IMG SRC=&quot;images/top-bar_04.gif&quot; WIDTH=109 HEIGHT=30 name=&quot;people&quot; border=&quot;0&quot;></a></TD>
                                
      <TD COLSPAN=2> <a href=&quot;clients.asp&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('clients','','images/top-bar_05_on.gif',1)&quot;><IMG SRC=&quot;images/top-bar_05.gif&quot; WIDTH=107 HEIGHT=30 name=&quot;clients&quot; border=&quot;0&quot;></a></TD>
        
      <TD> <a href=&quot;contact.asp&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('contact','','images/top-bar_06_on.gif',1)&quot;><IMG SRC=&quot;images/top-bar_06.gif&quot; WIDTH=108 HEIGHT=30 name=&quot;contact&quot; border=&quot;0&quot;></a></TD>
        
      <TD> <a href=&quot;download.asp&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('download','','images/top-bar_07_on.gif',1)&quot;><IMG SRC=&quot;images/top-bar_07.gif&quot; WIDTH=108 HEIGHT=30 name=&quot;download&quot; border=&quot;0&quot;></a></TD>
        
                <TD>
                        <IMG SRC=&quot;images/top-bar_08.gif&quot; WIDTH=484 HEIGHT=30></TD>
        </TR>
</TABLE>

</div>

in IE, it works fine, with the welcome layer in the top left, underneath the topbar layer (the reason the scripts that would normally be in the head aren't is because topbar is in an include file). However, in NN welcome layer is in about the right vertical position, but is about 10 px from the right side as opposed to the left side. Any suggestions?

Ben
 
Okay, it gets weirder. I've added the following layer as well:

Code:
<div id=&quot;picturelayer&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot;>
	<tr>
		<td height=&quot;1&quot;>
			<IMG SRC=&quot;images/vertical1.gif&quot; width=&quot;150&quot; height=&quot;212&quot;>
		</td>
	</tr>
	<tr>
		<td>
			<IMG SRC=&quot;images/vertical2.jpg&quot; width=&quot;150&quot; height=&quot;212&quot;>
		</td>
	</tr>
</table>
</div>

with the style:

Code:
#picturelayer {position:absolute; right:5px; top:90px; width:150px; height:430px; z-index:1}

Now this one turns out all the way over on the left! I messed around with the picturelayer positioning elements. If I set the left property to 0, the layer does move over to the left about 5 pixels. It looks like its relative anchor point is way over on the right hand side, but I can't figure out why.

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top