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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT!!! layers in tables (netscape 6)

Status
Not open for further replies.

maybe

Instructor
Jul 11, 2001
14
0
0
GB
Please can anybody explain why this does not work in netscape 6. It expands the table cell, it is although it is clipping the layers the remainder of the scrolling text is pushing the table cell down. The actual height of the table should only be 316 pixels.

Here is the code:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>

<script language=&quot;javascript&quot;>
// Netscape Resize Fix
if (document.layers) {
widthCheck = window.innerWidth
heightCheck = window.innerHeight
window.onResize = resizeFix
}
function resizeFix() {
if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
document.location.href = document.location.href
}
</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<table width=&quot;100%&quot; height=&quot;100%&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;>
<tr>
<td align=&quot;center&quot; valign=&quot;middle&quot;>
<table width=&quot;700&quot; height=&quot;312&quot; border=&quot;1&quot;>
<tr>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;396&quot;>
&nbsp;
</td>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;121&quot;>&nbsp;</td>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;161&quot;>&nbsp;</td>
</tr>
<tr>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;396&quot;>
<div style=&quot;background-color:#FFFFDD;width:155&quot;>
<center>
<a href=&quot;javascript:movedown()&quot;>Down</a> <a href=&quot;javascript:moveup()&quot;>Up</a>
<a href=&quot;javascript:stopscroll()&quot;>Stop</a> <a href=&quot;javascript:movetop()&quot;>Top</a>
</center>
</div>
<SCRIPT language=&quot;JavaScript1.2&quot;>

//specify speed of scroll (greater=faster)
var speed=4

iens6=document.all||document.getElementById
ns4=document.layers

if (iens6){
document.write('<div id=&quot;container&quot; style=&quot;position:relative;width:350;height:160px;overflow:hidden;border:2px ridge white&quot;>')
document.write('<div id=&quot;content&quot; style=&quot;position:absolute;width:350;left:0;top:0&quot;>')
}
</script>
<ilayer name=&quot;nscontainer&quot; width=350 height=160 clip=&quot;0,0,350,160&quot;>
<layer name=&quot;nscontent&quot; width=350 height=160 visibility=hidden>
<!--INSERT CONTENT HERE-->
<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<p>This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.
This is dummy copy and is only intended to be read as an example of text.</p>

<!--END CONTENT-->
</layer>
</ilayer>

</td>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;121&quot; height=&quot;263&quot;>&nbsp;</td>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;161&quot;>&nbsp;</td>
</tr>
<tr>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;396&quot;>&nbsp;</td>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;121&quot;>&nbsp;</td>
<td align=&quot;center&quot; valign=&quot;middle&quot; width=&quot;161&quot;>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<script language=&quot;JavaScript1.2&quot;>
if (iens6){
document.write('</div></div>')
var crossobj=document.getElementById? document.getElementById(&quot;content&quot;) : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}

function movedown(){
if (window.moveupvar) clearTimeout(moveupvar)
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout(&quot;movedown()&quot;,100)
}

function moveup(){
if (window.movedownvar) clearTimeout(movedownvar)
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout(&quot;moveup()&quot;,100)
}

function stopscroll(){
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}

function movetop(){
stopscroll()
if (iens6)
crossobj.style.top=0
else if (ns4)
crossobj.top=0
}

function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility=&quot;show&quot;
}
window.onload=getcontent_height
</script>
</body>
</html>
 
Change the position on the &quot;content&quot; div to relative...

document.write('<div id=&quot;content&quot; style=&quot;[red]position:relative[/red];width:350;left:0;top:0&quot;>')
 
Look at something to much and you don't see. Thanks very much. aperfectcirle


TA TA for now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top