Creo que tu problema es de css, no de javascript. No obstante, se comprueba como te dijimos:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style>
#content{
height: 500px;
}
</style>
<script>
window.onload=function(){
if(document.getElementById('content').offsetHeight>500)
document.getElementById('content').style.height='500px';
document.getElementById('content').style.overflow='auto';
}
</script>
</head>
<body>
<div id="content">
<p>Lorem Ipsum is simply dummy text of the printing and<br />
typesetting industry. Lorem Ipsum has been the industry's standard dummy text<br />
ever since the 1500s, when an unknown printer took a galley of type and scrambled<br />
it to make a type specimen book. It has survived not only five centuries, but<br />
also the leap into electronic typesetting, remaining essentially unchanged.<br />
It was popularised in the 1960s with the release of Letraset sheets containing<br />
Lorem Ipsum passages, and more recently with desktop publishing software like<br />
Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is<br />
a long established fact that a reader will be distracted by the readable content<br />
of a page when looking at its layout. The point of using Lorem Ipsum is that<br />
it has a more-or-less normal distribution of letters, as opposed to using 'Content<br />
here, content here', making it look like readable English. Many desktop publishing<br />
packages and web page editors now use Lorem Ipsum as their default model text,<br />
and a search for 'lorem ipsum' will uncover many web sites still in their infancy.<br />
Various versions have evolved over the years, sometimes by accident, sometimes<br />
on purpose (injected humour and the like).Lorem Ipsum is simply dummy text<br />
of the printing and typesetting industry. Lorem Ipsum has been the industry's<br />
standard dummy text ever since the 1500s, when an unknown printer took a galley<br />
of type and scrambled it to make a type specimen book. It has survived not<br />
only five centuries, but also the leap into electronic typesetting, remaining<br />
essentially unchanged. It was popularised in the 1960s with the release of<br />
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop<br />
publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br />
Why do we use it? It is a long established fact that a reader will be distracted<br />
by the readable content of a page when looking at its layout. The point of<br />
using Lorem Ipsum is that it has a more-or-less normal distribution of letters,<br />
as opposed to using 'Content here, content here', making it look like readable<br />
English. Many desktop publishing packages and web page editors now use Lorem<br />
Ipsum as their default model text, and a search for 'lorem ipsum' will uncover<br />
many web sites still in their infancy. Various versions have evolved over the<br />
years, sometimes by accident, sometimes on purpose (injected humour and the<br />
like).Lorem Ipsum is simply dummy text of the printing and typesetting industry.<br />
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,<br />
when an unknown printer took a galley of type and scrambled it to make a type<br />
specimen book. It has survived not only five centuries, but also the leap into<br />
electronic typesetting, remaining essentially unchanged. It was popularised<br />
in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,<br />
and more recently with desktop publishing software like Aldus PageMaker including<br />
versions of Lorem Ipsum. Why do we use it? It is a long established fact that<br />
a reader will be distracted by the readable content of a page when looking<br />
at its layout. The point of using Lorem Ipsum is that it has a more-or-less<br />
normal distribution of letters, as opposed to using 'Content here, content<br />
here', making it look like readable English. Many desktop publishing packages<br />
and web page editors now use Lorem Ipsum as their default model text, and a<br />
search for 'lorem ipsum' will uncover many web sites still in their infancy.<br />
Various versions have evolved over the years, sometimes by accident, sometimes<br />
on purpose (injected humour and the like).Lorem Ipsum is simply dummy text<br />
of the printing and typesetting industry. Lorem Ipsum has been the industry's<br />
standard dummy text ever since the 1500s, when an unknown printer took a galley<br />
of type and scrambled it to make a type specimen book. It has survived not<br />
only five centuries, but also the leap into electronic typesetting, remaining<br />
essentially unchanged. It was popularised in the 1960s with the release of<br />
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop<br />
publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br />
Why do we use it? It is a long established fact that a reader will be distracted<br />
by the readable content of a page when looking at its layout. The point of<br />
using Lorem Ipsum is that it has a more-or-less normal distribution of letters,<br />
as opposed to using 'Content here, content here', making it look like readable<br />
English. Many desktop publishing packages and web page editors now use Lorem<br />
Ipsum as their default model text, and a search for 'lorem ipsum' will uncover<br />
many web sites still in their infancy. Various versions have evolved over the<br />
years, sometimes by accident, sometimes on purpose</p>
</div>
</body>
</html>