469,301 Members | 2,278 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,301 developers. It's quick & easy.

Link to same page

119 100+
Hi to all,

I am trying to do some link management in my page, that is i have few contents in my page each have his own headings, like

links:

> heading 1
> heading 2
> heading 3

contents:

heanding1
xxxx
yyyyy
yyyy
yyyy

heading 2
xyz
xyz
xyz

heading 3
123
1231
123456

Now what i want to do is, i want to create a link for every headings like

<a href=#heading1>heading1</a>

When the user clicks in that link, then the content for that link should come up to the front,

this task is already furnished in wikipedia - sample

i want the same process for my page..

Can anyone help me please,

Thanks in advance,

Regards
magesh
Dec 12 '08 #1
6 4692
I take it you mean the content section of the Wiki page.
Could you not use anchors on your headers?

eg.
<a name = "header1">heading 1</a>
Header 1 Contents

Then for you link just <a href = "#header1"> Header 1 </a>

Is that what your looking for?
Mr. Prister
Dec 12 '08 #2
phpmagesh
119 100+
@Mr Prister
Hi

Thank you dude,

Regards
magesh
Dec 12 '08 #3
Hi there... no probs,

Just thought if you actually using header tags

eg. <h1>Header 1</h1>

Then you can simply give the header an ID:
<h1 id = "header 1">Header 1</h1>
Then reference that just like you would the anchor.

I don't think it matters which you use but that one looks nice!
Dec 12 '08 #4
Dormilich
8,651 Expert Mod 8TB
@Mr Prister
except that whitespace is not allowed in an ID. (only letters, digits, underscores, hyphens, periods and colons)

regards
Dec 12 '08 #5
@Dormilich

Damn you with your correctness and damn me for the mistake... but a valid point none the less.
Dec 12 '08 #6
Dormilich
8,651 Expert Mod 8TB
@Mr Prister
damn yes. I'm sure there are a lot of people out there who do not know that fact.
Dec 12 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by crhaynes | last post: by
3 posts views Thread by VIJAY KUMAR | last post: by
1 post views Thread by Aki | last post: by
26 posts views Thread by Harrie | last post: by
36 posts views Thread by randau | last post: by
6 posts views Thread by Andreas Prilop | last post: by
2 posts views Thread by Keith G Hicks | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.