HTML Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsOtherHTML Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread SEO Chat Forums Sponsor:
  #1  
Old January 8th, 2008, 05:11 AM
Aami Aami is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 43 Aami User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 23 m 20 sec
Reputation Power: 4
Send a message via MSN to Aami Send a message via Yahoo to Aami
Question Use of # (Hash) Symbol in a hyper link

Hello All

I am having some problems with my anchor links. I am using the following code <a href="#">Link Title</a>. The problem I am facing is that When I Click the link, I am directed to the top of the page. But What I want is to stay where I was before clicking on the link. I know that use of javascript:; (like <a href="javascript:;">Link Title</a>) can solve this problem for me, but I want this to be done by using # symbol and not javascript:;.

Can some one please help me in resolving this issue. Thanking all in advance.
__________________
--------------------------------------------------------------------------------------
Dubai Property, Article Directory
International Property,

Reply With Quote
  #2  
Old January 8th, 2008, 05:21 AM
JagNet JagNet is offline
Smoke me a kipper...
Click here for more information
 
Join Date: Aug 2007
Posts: 1,776 JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 22 h 32 m 20 sec
Reputation Power: 30
Perhaps make use of anchor links, eg:
Code:
<a href="#anchor">Link Text</a><a name="anchor"></a>....
You'll still see some movement (the link will move to the top of the visible screen) but you won't return to the top of the page itself.

It does beg the question, what are you trying to do to need this without javascript? Ordinarily, you'd find a hashed link used in conjunction with a javascript function. I can't think of any reasons to use it on its own.

Reply With Quote
  #3  
Old January 8th, 2008, 05:26 AM
dr john dr john is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 51 dr john User rank is Corporal (100 - 500 Reputation Level)dr john User rank is Corporal (100 - 500 Reputation Level)dr john User rank is Corporal (100 - 500 Reputation Level)dr john User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 17 h 16 m 47 sec
Reputation Power: 2
Anchor links are links to named anchor points on the page (eg top, bottom, section-2).
Why would you establish a link to nowhere and then click it to stay where you were? Why would you click it full stop?

It goes to the top of the page because it can't find any point named # on your page.

If you wish to click the link and go to where you already are, then first you have to create a named anchor point next to it.
eg <a name="top"> or <a name="section-2"> and then use that name in the <a href="#top">

EDIT
Snap!
Simultaneous typing of replies.
Comments on this post
JagNet agrees: great minds think alike, or fools seldom differ?!

Last edited by dr john : January 8th, 2008 at 05:30 AM.

Reply With Quote
  #4  
Old January 8th, 2008, 06:54 AM
Aami Aami is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 43 Aami User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 23 m 20 sec
Reputation Power: 4
Send a message via MSN to Aami Send a message via Yahoo to Aami
I want to develop a control for my site just like the control given on www.msn.com. If you view the home page of www.msn.com, and look at the different sections like MSNBC News, FOX Sports, etc., you would find two links for displaying show more headlines, and show fewer headlines (+ and -). All these link are linked to a url http://www.msn.com/#. I want to know that how this can be done. Can you please explain.

Last edited by Aami : January 8th, 2008 at 07:02 AM.

Reply With Quote
  #5  
Old January 8th, 2008, 06:57 AM
JagNet JagNet is offline
Smoke me a kipper...
Click here for more information
 
Join Date: Aug 2007
Posts: 1,776 JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level)JagNet User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 22 h 32 m 20 sec
Reputation Power: 30
Quote:
Originally Posted by Aami
I want to know that how is this possible. Can you please explain.
Javascript

Reply With Quote
  #6  
Old January 19th, 2008, 05:15 PM
sen77 sen77 is offline
Registered User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Kiev
Posts: 1 sen77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 41 sec
Reputation Power: 0
Send a message via Google Talk to sen77
Quote:
Originally Posted by Aami
I want to know that how this can be done. Can you please explain.


href="#" onclick="return false"

this should work

Reply With Quote
Reply

Viewing: SEO Chat ForumsOtherHTML Coding > Use of # (Hash) Symbol in a hyper link


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT