kippie
08-14-2002, 02:47 PM
In the HTML below the text for layer2 is too big for the dimensions of the <div>. Is it possible to make it so that automatically a scrollbar appears if the text is too big for the <div> and the <div> itself keeps the same size?
This it the HTM:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<title>Welcome to Adobe GoLive 4</title>
<style type="text/css"><!--
#layer1 { background-color: #C0C0C0; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }
#layer2 { background-color: #FFA07A; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }
#layer3 { background-color: #F0E68C; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }
#layer4 { background-color: #1E90FF; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }-->
</style>
<script language="JavaScript">
<!--
lastone='empty';
function showIt(lyr)
{
if (lastone!='empty') lastone.style.visibility='hidden';
lastone=document.getElementById(lyr);
lastone.style.visibility='visible';
}
//-->
</script>
</head>
<body onload="showIt('layer1')">
<span>Pick a layer:<br />
<a href="JavaScript:;" onClick="showIt('layer1')" >layer1</a>
<a href="JavaScript:;" onClick="showIt('layer2')"> layer2</a>
<a href="JavaScript:;" onClick="showIt('layer3')"> layer3</a>
<a href="JavaScript:;" onClick="showIt('layer4')"> layer4</a>
</span>
<div id="layer1">
This is layer1</div>
<div id="layer2">
This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2</div>
<div id="layer3">
This is layer 3</div>
<div id="layer4">
This is layer 4</div>
</body>
</html>
This it the HTM:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<title>Welcome to Adobe GoLive 4</title>
<style type="text/css"><!--
#layer1 { background-color: #C0C0C0; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }
#layer2 { background-color: #FFA07A; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }
#layer3 { background-color: #F0E68C; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }
#layer4 { background-color: #1E90FF; position: absolute; top: 100px; left: 200px; width: 100px; height: 100px; visibility: hidden }-->
</style>
<script language="JavaScript">
<!--
lastone='empty';
function showIt(lyr)
{
if (lastone!='empty') lastone.style.visibility='hidden';
lastone=document.getElementById(lyr);
lastone.style.visibility='visible';
}
//-->
</script>
</head>
<body onload="showIt('layer1')">
<span>Pick a layer:<br />
<a href="JavaScript:;" onClick="showIt('layer1')" >layer1</a>
<a href="JavaScript:;" onClick="showIt('layer2')"> layer2</a>
<a href="JavaScript:;" onClick="showIt('layer3')"> layer3</a>
<a href="JavaScript:;" onClick="showIt('layer4')"> layer4</a>
</span>
<div id="layer1">
This is layer1</div>
<div id="layer2">
This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2, This is layer 2</div>
<div id="layer3">
This is layer 3</div>
<div id="layer4">
This is layer 4</div>
</body>
</html>