Log in

View Full Version : Jump to the content



neo_philiac
10-06-2006, 12:56 PM
Hey guys! I was just wondering if there is a jscript code to jump to the middle (or where my content is) of the page if i click on the link on the same page. if not how would you do it anyways?

chechu
11-01-2006, 04:57 PM
use <a href="#name">click here</a>

ddadmin
11-02-2006, 12:03 AM
To elaborate, what you want is a link anchor. Right beside the content you want users to jump to when a link is clicked on the same page, add an anchor:


<a name="#gohere"></a><p>My middle content here</p>

Then, anywhere on your page, create a link that takes the user to the above when clicked on by doing:


<a href="#gohere">Jump to content</a>

djr33
11-02-2006, 04:34 AM
I thought that one needed the # and the other didn't.
Isn't it:
<a name="anchor">
<a href="#anchor">?

codeexploiter
11-02-2006, 05:10 AM
Yes djr33 is correct



<a name="gohere"></a><p>My middle content here</p>
.
.
.
.
.
.
.
.
.
.
.
.
.
<a href="#gohere">Jump to content</a>

djr33
11-02-2006, 05:52 AM
Though, I'm not sure, and maybe both are correct.
I'm assuming someone will be able to clear it up soon.

ddadmin
11-02-2006, 06:41 AM
Ah yes technically the anchor itself shouldn't have the "#" prefix, though it seems with it doesn't change the behavior.