Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pls help with pop-up functions.

Status
Not open for further replies.

formatCreturn

Technical User
Jun 24, 2006
2
GB
I get javascript errors with my pop-up menu. checkDiv() won't run at all.
Forgive me for being a noob but am banging my head against a wall about this...
Sub menu div box is hidden as default.

<script language="JavaScript">
//set global variables
var a=0;
var b=0;
/*hide sub menu div box if mouse not over div box or main link*/
function checkDiv(){
if(a==0 && b==0) {
Links2.style.display="none";
}
else {
Links2.stlye.display="block";
};
}
//onMouseOver main link for sub menu
function openDiv(){
a=1;
checkDiv();
}
//onMouseOut main link for sub menu
function closeDiv(){
a=0;
setTimeout('checkDiv()',1000);
}
//onMouseOver sub menu div box
function onDiv(){
b=1;
'checkDiv()';
}
//onMouseOut sub menu div box
function outDiv(){
b=0;
setTimeout('checkDiv()',1000);
}

</script>

onDiv and outDiv are coded into <div> tag so appreciate non-Netscape compliance.
Thanks - and be nice if my code is crap.
 
Never mind. Fixed it!
did...
function checkDiv(){
if(a==0 && b==0) {
document.getElementById("Links2").style.display="none";
}

...and moved "Links2" from external .css file into "document".
Works a treat now.
Just need to work out how to reference external css file instead of "document" and I'm there.

Thanks for reading.
Feel free to reply with tips if you have some. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top