English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to click a link onn my page and have it run a function, then I want it to jump to the position of an anchor

ie

onclick="javascript:jumpTo();"
and then jump to the location:


www.ryandebraal.com
(I want the .net and dx9 icons to link to the driver section)

2006-06-17 15:17:28 · 2 answers · asked by ryandebraal 3 in Computers & Internet Programming & Design

2 answers

Oh ryan, it is relatively simple. I did it to one of my webapplications.Technically after you press on your javascript jumpTo(); button you could have this:
onclick=" javascript:jumpTo(); window.location= '/drivers.html#here';"

And of course you have within your drivers.html the anchor.
+ OpenGL
The reason why I placed a + next to OpenGL is that people can navigate faster, you can wish not to place it.

I hope you understand that. Try doing a simple link to understand what window.location does. like:

That will navigate to your /page1.html page. Good luck on your quest :) Nice website you have there :) Game programming is nice :)

2006-06-17 18:02:03 · answer #1 · answered by ? 6 · 0 0

Use the # anchor.
Click here to go there.

Go there

You can just put it IN the tag itself like:
Click here to go there.

If you really really need to use javascript, then try location.hash.

onclick="javascript:location.hash='#hash'"

2006-06-17 22:22:49 · answer #2 · answered by Sean I.T ? 7 · 0 0

fedest.com, questions and answers