Forum Moderators: open

Message Too Old, No Replies

Anchor show hidden content

Need an anchor to hidden content from main page and show it

         

1stLibAdmin

6:56 pm on Oct 2, 2006 (gmt 0)

10+ Year Member



I am using the Function show() and hide() for each header on a page. This allows me to open and close each header paragraph. Currently from the main page menu I have the page link to 'page.htm?show='unhiddenparagraph' I would like to be able to continue my hide() and show(), but also open the 'page.htm?show='unhiddenparagraph' to the 'unhiddenparagraph'. I tried using name="#blahblahblah" in the <a> tag but all that did is show the header without the text, and I was unable to close the header once it became open.
Can someone please help?

foobar

5:12 am on Oct 3, 2006 (gmt 0)

10+ Year Member



an anchor is like this:

<a name="asdf"></a>

And is access like this:

[url.com...]

The name does not contain a # pound sign. Apart from that, I don't understand your question. Can you rephrase?

penders

2:01 pm on Oct 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am using the Function show() and hide() for each header on a page. This allows me to open and close each header paragraph. Currently from the main page menu I have the page link to 'page.htm?show='unhiddenparagraph'....

The show() and hide() functions you talk about are not standard / built in JavaScript functions. And your anchor "

page.htm?show='unhiddenparagraph'
" does not directly call one of these functions. It passes a value (I guess the ID of a P or DIV element) as the value of the 'show' variable in a querystring to page.htm. Some code in page.htm then has to interpret this.

I guess you have something like:

<h2>Heading One</h2> 
<div id="heading1text"><p>Blah blah blah...</p></div>

<h2>Heading Two</h2>
<div id="heading2text"><p>Blah blah blah...</p></div>

etc...

And you are perhaps wanting to show/hide the different text elements, maybe? Like foobar says, the IDs of your page elements you are wanting to show/hide are unlikely to contain the '#' symbol, so this is possibly where it's 'breaking'. And I am also unclear as to what you are trying to do exactly.

You could perhaps post the code of your show() / hide() functions as well as the HTML markup and an explanation...

... and welcome to WebmasterWorld.