Current location: Hot Scripts Forums » General Web Coding » JavaScript » [SOLVED] using javascript to 'jump to anchor'


[SOLVED] using javascript to 'jump to anchor'

Reply
  #11 (permalink)  
Old 10-21-08, 06:19 AM
kaaspertje kaaspertje is offline
New Member
 
Join Date: Oct 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
adding notes

i mean, the script worksin safari , but it does not jump to the anchor
maybe i have to add a page reload?

note that it is not possible to use the '#content'. i do not know why, but is does not work
Reply With Quote
  #12 (permalink)  
Old 10-28-08, 12:48 AM
whitehorse whitehorse is offline
New Member
 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
This was helpful. I modified it to place multiple anchor links at the top of the window inside an accordian javascript widget. Works great. Here is the code I used:

In header:

Code:
<script type="text/javascript" language="javascript">
	function moveWindow1 (){window.location.hash="SERVICES";}
	function moveWindow2 (){window.location.hash="SOFTWARE";}
	function moveWindow3 (){window.location.hash="HOSTING";}
</script>
In body:

Code:
<a href="#" onclick="moveWindow1()">Services</a> | <a href="#" onclick="moveWindow2()">Software</a> | <a href="#" onclick="moveWindow3()">Hosting</a>
Wherever you want to link to in the window:

Code:
<a name="SERVICES"></a> 
and so on and so forth...
Reply With Quote
  #13 (permalink)  
Old 09-07-10, 02:06 AM
Nico.AnvilStudios Nico.AnvilStudios is offline
New Member
 
Join Date: Sep 2010
Location: South Africa
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for all the sharing @kaaspertjie.
I also had to figure this out a while back, then I ended up writing a blog article about it. I see this is an old post and so a lot of the methods used are old as well though... If any of you guys are interested in a JQuery solution you can check out my article: [removed URL]

Last edited by Nico; 09-07-10 at 06:17 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
execute php into javascript function Hagoromo PHP 3 05-23-07 02:19 AM
javascript menu covered by java applet shaisachs JavaScript 7 12-28-04 11:38 PM
Reaaly stuck about javascript over frames muratisik JavaScript 1 12-14-03 11:58 AM
php and javascript together? gamextremer2003 PHP 5 11-06-03 02:18 PM
Forcing a JavaScript to abort HiMyNameIs JavaScript 3 09-18-03 10:23 AM


All times are GMT -5. The time now is 11:46 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.