Albert Lewis
07-22-2005, 02:11 PM
Hey guys i am really suck on this so any help would be nice.
Right now on the site i am building i am using a nice CSS menu which uses the following javascript.
<SCRIPT TYPE="text/javascript">
<!--
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}
//-->
</SCRIPT>
And this (http://tutorials.alsacreations.com/modelesmenus/hd2.htm) is what the menu looks like.
When i insert the following javascript scrolling text code on the same page
<script language="JavaScript1.2">
/*
Scrolling Text script-
Distributed by http://www.hypergurl.com
*/
//Change script's width (in pixels)
var marqueewidth=300
//Change script's height (in pixels, pertains only to NS)
var marqueeheight=20
//Change script's scroll speed (larger is faster)
var speed=6
//Change script's contents
var marqueecontents='<font face="Arial" font color="#FFFFFF"><strong><big>Have fun with this script from <a href="http://www.hypergurl.com">Hypergurl</a> If you find this script useful, please consider linking to us!</big></strong></font><background color="#00080">'
if (document.all)
document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqueewidth
scrollit()
}
}
window.onload=regenerate2
</script> <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer></ilayer>
When the page loads, every single sub menu items is visible, like if you had 4 cursors so you could mouseover every single menu with a submenu at once. I believe it has something to do with the show and hide layers but I can't figure it out because my JavaScript knowledge is not that great yet.
Any help would be great.
Right now on the site i am building i am using a nice CSS menu which uses the following javascript.
<SCRIPT TYPE="text/javascript">
<!--
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}
//-->
</SCRIPT>
And this (http://tutorials.alsacreations.com/modelesmenus/hd2.htm) is what the menu looks like.
When i insert the following javascript scrolling text code on the same page
<script language="JavaScript1.2">
/*
Scrolling Text script-
Distributed by http://www.hypergurl.com
*/
//Change script's width (in pixels)
var marqueewidth=300
//Change script's height (in pixels, pertains only to NS)
var marqueeheight=20
//Change script's scroll speed (larger is faster)
var speed=6
//Change script's contents
var marqueecontents='<font face="Arial" font color="#FFFFFF"><strong><big>Have fun with this script from <a href="http://www.hypergurl.com">Hypergurl</a> If you find this script useful, please consider linking to us!</big></strong></font><background color="#00080">'
if (document.all)
document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqueewidth
scrollit()
}
}
window.onload=regenerate2
</script> <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer></ilayer>
When the page loads, every single sub menu items is visible, like if you had 4 cursors so you could mouseover every single menu with a submenu at once. I believe it has something to do with the show and hide layers but I can't figure it out because my JavaScript knowledge is not that great yet.
Any help would be great.