Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Javascript Help Please


  • Please log in to reply

#1
yaddie

yaddie

    New Member

  • Member
  • Pip
  • 1 posts
Hi I have this code in Javascript that will expand a Menu if you click a link and then it will close it again if you click on the link again.

I like alot but the problem is that when you click on the Menu it expands it, but when you click on the links that are expanded it will close the menu when you go to that link. Am I making sense? How can I have it stay open(expanded) even if it goes to another page?

Here is the code:

<script language=javascript type=text/javascript>
<!--
// preloads expand images and the dot
if(document.images)
{
expandC = new Image
expandC.src="images/arrow.gif"
expandO = new Image
expandO.src="images/arrow_down.gif"
}
function expand(expandWhat)
{
var exEle = expandWhat
var current = document.getElementById(exEle).style.display
if (current == "none")
{
document.getElementById(exEle).style.display="";
if (document.images)
document.getElementById(exEle + 'Img').src = expandO.src;
}
else
{
document.getElementById(exEle).style.display="none";
if (document.images)
document.getElementById(exEle + 'Img').src = expandC.src;
}
}
//-->
</SCRIPT>



Let me know if you need anything else. Thank you for ANY Help! :whistling:
  • 0

Advertisements


#2
knexor2

knexor2

    Member

  • Member
  • PipPip
  • 28 posts
It would help to be able to see your entire source code. What's the website?

I assume you have this fixed by now :whistling:
  • 0

#3
Mike-pxndx

Mike-pxndx

    Member

  • Member
  • PipPip
  • 54 posts
Same, just queep playing with the scource code and try to find out where is the error.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP