kippie
Technical User
- Nov 8, 2001
- 158
Can someone have a look into this HTML. In this code a text is placed in a table cell (textframe) with Link1 or Link2. The idea is that if the text is too large for the cell a scrollbar appears (Link1), while there's no scrollbar if the text nicely fits into the cell (Link2). This works nicely on my browser (IE6) but I have no idea how this works in Netscape.
This is the code:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<script language="JavaScript"><!--
//This is the function to change text on a changing background:
function htmlChange(id,message,bg){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.style.padding = "25px"
re.innerHTML=message;
re.style.background = "url("+bg+"";
}
var msg1 = 'This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1'
var msg2 = 'And this is text2 and this is tect2 and this is text2'
// -->
</script>
</head>
<body>
<table border="2" bordercolor="red" width="500" height="175" cellpadding="0" cellspacing="0">
<tr height="25">
<td id="headmenu" colspan="2" height="25"><a href="#" onclick="htmlChange('textframe2',msg1,'bgWhite.gif');">Link1</a> <a href="#" onclick="htmlChange('textframe2',msg2,'bgMidnightBlue.gif')">Link2</a></td>
</tr>
<tr height="175">
<td id="textframe" bgcolor="#4169e1" width="250" height="175" bordercolor="green" border="3">
<div style="width:250px; height:175px; overflow-y:auto; overflow-x: hidden">
<table cellpadding="25">
<tr height="150">
<td id="textframe2" width="250" height="150" bordercolor="blue">Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Tex0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0</td>
</tr>
</table>
</div>
</td>
<td height="175"></td>
</tr>
</table>
</body>
</html>
Kippie
This is the code:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<script language="JavaScript"><!--
//This is the function to change text on a changing background:
function htmlChange(id,message,bg){
d=document;
re=d.all?d.all[id]:d.getElementById(id);
re.style.padding = "25px"
re.innerHTML=message;
re.style.background = "url("+bg+"";
}
var msg1 = 'This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1This is text1'
var msg2 = 'And this is text2 and this is tect2 and this is text2'
// -->
</script>
</head>
<body>
<table border="2" bordercolor="red" width="500" height="175" cellpadding="0" cellspacing="0">
<tr height="25">
<td id="headmenu" colspan="2" height="25"><a href="#" onclick="htmlChange('textframe2',msg1,'bgWhite.gif');">Link1</a> <a href="#" onclick="htmlChange('textframe2',msg2,'bgMidnightBlue.gif')">Link2</a></td>
</tr>
<tr height="175">
<td id="textframe" bgcolor="#4169e1" width="250" height="175" bordercolor="green" border="3">
<div style="width:250px; height:175px; overflow-y:auto; overflow-x: hidden">
<table cellpadding="25">
<tr height="150">
<td id="textframe2" width="250" height="150" bordercolor="blue">Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Tex0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0 Text0</td>
</tr>
</table>
</div>
</td>
<td height="175"></td>
</tr>
</table>
</body>
</html>
Kippie