I’ve written a javascript, but its not working in Firefox, i don’t know why not ?
Also i like to change someting to the script.
Is it possible to change this:
[code=html]newheight=200;
if(theheight<newheight){
to this: (the newheight should be he height of another div, i tryed the code below but it isnt working)
[code=html]newheight=document.getElementById(content1).offsetHeight;
if(theheight<newheight){
My complete code:
[code=html]<!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>Untitled Document</title>
<link href=”ww.css” rel=”stylesheet” type=”text/css” />
<script type=”text/javascript”>
function grow(targetid){
theheight=document.getElementById(targetid).offsetHeight;
newheight=200;
if(theheight<newheight){
document.getElementById(targetid).style.height=theheight+0,1+’px’;
}else{
document.getElementById(“content”).innerHTML = document.getElementById(“content1”).innerHTML;
}
}
setInterval(“grow(‘content’)”,1);
</script>
</head>
<body>
<div id=”header”></div>
<div id=”content”></div>
<div id=”footer”></div>
<div id=”content1″ style=”visibility:hidden”>dit is de oude inhoud<BR /><BR />asdfsadfsds</div>
</body>
</html>
And my css file:
[code=html]/* CSS Document */
body{
background-image:url(img/background.png);
background-repeat:repeat-x;
background-color:#619BCA;
text-align:center;
margin-top:0px;
}
div#header{
height: 464px;
width: 871px;
background-image:url(img/header.png);
}
div#content{
width: 754px;
height: 0px;
background-color: #A8C8E1;
border:1px solid #000000;
border-style:hidden;
border-width:1px;
border-color:#A8C8E1;
}
div#footer{
height: 22;
width: 871px;
background-image:url(img/footer.png);
}#thediv {
border:1px solid #000000;
background-color:#0000FF;
}
Maybe there is a better solution for this problem?
Sometimes it is shocking… and it could go some faster. But if i change it its shocking to much…
I hope you can help me….
And is there a posibility to fade the text into the div instead of just place it there ?