-
body onload
There are two body onloads needed on my page. How can I mix them ?
Here they are:
Code:
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="document.getElementById('loading').style.display = 'none';document.getElementById('content').style.display = 'inline';">
<div id="loading">
<img src="images/header.jpg" style="border: 0px; text-align:center; margin-top:1px;">
<p align=center><b>TITLE</b>
<p align=center>subtitle
<p align=center><br> <br><img src="images/loader.gif" style="border: 0px;">
</div>
<div id='content' style='display:none;'>
and
Code:
onload="initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel, 'saveit')"
-
This should do it:
Code:
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="document.getElementById('loading').style.display = 'none';document.getElementById('content').style.display = 'inline';initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel, 'saveit');">
<div id="loading">
<img src="images/header.jpg" style="border: 0px; text-align:center; margin-top:1px;">
<p align=center><b>TITLE</b>
<p align=center>subtitle
<p align=center><br> <br><img src="images/loader.gif" style="border: 0px;">
</div>
<div id='content' style='display:none;'>
-
No, doesn't work. The first one comes up (with the divs), the other doesn't.
The second one is the dropdown select (four).
You can see it here
-
Change that "inline" to block. Then set the float to left (use clear:both on a following element).
-
Try:
Code:
<script type="text/javascript">
var onLoadfunc = function(){
document.getElementById('loading').style.display = 'none';
document.getElementById('content').style.display = 'inline';
initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel, 'saveit');
}
</script>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadfunc();">
<div id="loading">
<img src="images/header.jpg" style="border: 0px; text-align:center; margin-top:1px;">
<p align=center><b>TITLE</b>
<p align=center>subtitle
<p align=center><br> <br><img src="images/loader.gif" style="border: 0px;">
</div>
<div id='content' style='display:none;'>
-
Nile, yours still doesn't work.
Mburt, I do not understand you very well.
-
Using Nile's script...
Code:
<script type="text/javascript">
var onLoadfunc = function(){
document.getElementById('loading').style.display = 'none';
document.getElementById('content').style.display = 'block';
document.getElementById('content').style.float = 'left';
initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel, 'saveit');
}
</script>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadfunc();">
<div id="loading">
<img src="images/header.jpg" style="border: 0px; text-align:center; margin-top:1px;">
<p align=center><b>TITLE</b>
<p align=center>subtitle
<p align=center><br> <br><img src="images/loader.gif" style="border: 0px;">
</div>
<div id='content' style='display:none;'>
Now this is only assuming... I haven't looked deeply into the matter.
-
You can have a new onload event of window object which triggers both the operations you've mentioned in your code. Insert the following code in your script element and remove the "onload" event from the body element, both ones should be removed. If you have multiple onload events on "window" object only one will be executed. So if you have more than one scripts that needs to be executed as a part of the onload event of "window", we used to club them together the way I've done below:
Code:
window.onload = function(){
document.getElementById('loading').style.display = 'none';
document.getElementById('content').style.display = 'inline';
initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, document.listmenu0.fourthlevel, 'saveit')
}
Before doing so make sure that the 'initListGroup' function call is meaningful and work with the mentioned parameters.
It would be better if you post a link of your page so that everyone can have a look at it.
Hope this helps.
-
I actually think it has to do with the inline style property. It doesn't always work cross-browser.
-
Mike, Actually it works but the fourth select list will be enabled only a number of occassions.
If you load the following values in the respective select list then the fourth select list will be enabled
select1 -> Vakantiepark
select2 -> CenterParcs
Select3 -> Belgie or Select3 -> Nederland
But I don't think the script's function is correct seems to be somewhat inconsistent though...
Chechu plz post a link to the menu script you use.