Google Answers Logo
View Question
Q: Hide - Show a list of links ( Answered 4 out of 5 stars,   1 Comment )
Subject: Hide - Show a list of links
Category: Computers > Internet
Asked by: trimidium-ga
List Price: $2.00
Posted: 05 Feb 2004 12:46 PST
Expires: 06 Mar 2004 12:46 PST
Question ID: 303853
I want to have a link on my page that could be clicked on one side of
the screen and on the other side of the screen an entire set of links

I would prefer it is in php or css but html, javascript are fine... 
What I don't want to do is load the content in a seperate frame/iframe
i want to have like 10 categories of links and onmouseover the links
inside the category appear, but in a different positioned location on
the page.

example of what i want it to do:
<a href="#buyme" onmouseover="this.className='hide-show-buyme-list';
'hide-all-other-lists;'">Buy Me</a>
<a href="#buyme2" onmouseover="this.className='hide-show-buyme2-list';
hide-all-other-lists;'">Buy Me2</a>

<span class="hide-show-variable-or-something1" name="buyme">
<a href="link1.htm">link1</a><br>
<a href="link2.htm>link2</a><br>
<span class="hide-show-variable-or-something2" name="buyme2">
<a href="link3.htm">link1</a><br>
<a href="link4.htm>link2</a><br>

as far as i know this should be a basic and easy thing to do with a
variable and php or even positioning on css, i just haven't gottent it
to work right.  The structure doesn't have to match mine at all, just
needs to get the job done.

Thanks in advance.
Subject: Re: Hide - Show a list of links
Answered By: mosquitohawk-ga on 05 Feb 2004 19:43 PST
Rated:4 out of 5 stars
Greetings trimidium-ga,

What a great question for me, I just had to overcome this obstacle the
other day for a client's site I was designing.

I came across a script from Dynamic Drive
<> that will do exactly what you're
wanting. It's called the "Switch Content Script", is compatible with
all versions of Internet Explorer 4 and above, as well as Netscape 6.

This script utilizes a javascript placed in the <head> section of your
webpage, and then uses the following structure in the page:

<h3 onClick="expandcontent('sc1')" style="cursor:hand;
cursor:pointer">What is JavaScript?</h3>
<div id="sc1" class="switchcontent">
JavaScript is a scripting language originally developed by Netscape to
add interactivity and power to web documents. It is purely client
side, and runs completely on the client's browser and computer.

<h3 onClick="expandcontent('sc2')" style="cursor:hand;
cursor:pointer">Difference betwen Java & JavaScript?</h3>
<div id="sc2" class="switchcontent">
Java is completely different from JavaScript- the former is a compiled
language while the later is a scripting language.

The 'hidden' content does not necessarily have to follow the 'onClick'
element, and of course the 'onClick' element can be assigned to an
HTML anchor element (ie: <a href="#" onClick="expandcontent('sc2')"> )

You can view an example and all the source files on Dynamic Drive, here:

Also, if you need specialized help customizing the script, you can
find help for Dynamic Drive scripts here:

Best of luck,

trimidium-ga rated this answer:4 out of 5 stars
Thank You... It should work nicely for what i need ;)

Subject: Re: Hide - Show a list of links
From: sfxmystica-ga on 24 Mar 2004 13:12 PST
Perhaps you might this useful too ...

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy