473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Anchor Tag with #Name Moves Entire Window Up instead of 'Jumping'

This question was asked once on Bytes.com, but the 'asker' was Amateur to say the least and the question was never fully answered.

So here is the question. I am designing a page containing a listing of 'entries.' The title of the entry is linked and looks like shown below:

[HTML]<href="#e1" name="e1">Text</a>[/HTML]

The expected behavior of this is for the page to 'Jump' down to the element named 'e1' (in this case, itself), however, instead the entire page moves upward. The Header, navigation and everything above the element named 'e1' is now in the negative numbers.

It is as if this simple bahavior is making the element's parent container positioned absolute and then applying a negative value to the top, (example: top:-500px).

I have been making websites for quite a long time and never had any problem with this type of bahavior, nor have I ever seen this happen nor do I know what would ever cause this to happen. I have not debugged HTML to validate (the doctype is xhtml strict), as that could be the problem, but in my experience that should not effect the behavior of browser functionality.

The URL to see this quirky behavior in action is here
Very Odd Anchor Fragment Behavior
(Click on the title below the brown horizontal bar to replicate the issue)

(HTML, Doctype or CSS issue?)

I appreciate any advice you can offer, thanks for reading!
Aug 19 '08 #1
5 4728
drhowarddrfine
7,435 Expert 4TB
Your link doesn't show anything.
I assume you mean <a href=... and not just <href?

From your description, it sounds like it's behaving as it should but I guess I'm misunderstanding.
Aug 19 '08 #2
Yes, I miswrote the html, my apologies, but thanks for your attn to detail!

That's weird that the link doesn't work, it works perfectly for me! Apparently my server has been encountering DNS issues, and it only resolves part of the time. But I would like to ensure you, the link is not broken.

No, it is not behaving as it should.

Correct Behavior:
1) When clicked the page should 'Jump' or 'Scroll' to the Fragment. When looking at your scrollbar the bar would be part way down the page and there would be a gap between the position of the 'bar' and the top of the scroller.

This Occurence:
1) When clicked the page does not 'jump' or 'scroll' but instead the entire page is readjusted to the top of the screen. Now, when looking at the scrollbar the bar is completely at the top of the scroller, there is no gap between the 'bar' and the top of the scroller. The top of the page is now the Fragment belonging to the href. You can NOT scroll back up, as that Fragment is NOW the TOP of the page.

Sorry if there is redundancy, but this issue is relatively difficult to explain with text, something you have to experience for yourself. Maybe a screenshot would help ... that would be my next post
Aug 19 '08 #3
drhowarddrfine
7,435 Expert 4TB
Yes, I know how it's supposed to work but I wasn't sure you meant it jumped to the top. Does it happen if you don't point that href at itself?
Aug 19 '08 #4
Just tried moving the name parameter to a different element; and yes, the odd behavior is a persistent little bugger.

Here are screenshots for clarity: (you may not be able to see them due to being on the same server you cannot access, if this be the case, reply and I will upload to photo host.)

before:


after:

Aug 19 '08 #5
I have discovered the source of the problem, maybe this could be of help to anyone who may experience the same issue anytime in the future.

For this design I experimented with some code I found on AListApart. The code is used to make all columns equal height, so if one had more content than another, it would still be 100% high. The code for this is below:

Expand|Select|Wrap|Line Numbers
  1.     #container .column {
  2.         padding-bottom: 1001em;     
  3.         margin-bottom: -1000em;
  4.     }
  5.  
This 'equal height columns' code effectively destroys the Anchor Fragment functionality.

In my case I will now have to replace this more semantic approach with the uglier approach of giving my container a background-image to simulate equal height columns; or simply find a fix for this.

Thx dr for your attempt to help me, I appreciate your repid responses, have a great one!
Aug 19 '08 #6

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

Similar topics

4
by: catyionic | last post by:
Greetings: I have numerous links on index.html...example of one..... <A HREF="stage.html#Flash" target="left">Flash</A> It connects to page named stage.html ... which contains... <a...
1
by: Robert Mark Bram | last post by:
Hi All, We are using a scrolling iFrame to present a list of options to the user within the main page with an anchor against each option. Depending on the user actions, we jump to an anchor in...
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
10
by: elibol | last post by:
Hi, Is there an event that fires when the back or forward button on a browser is pressed? I need an event to fire when someone clicks the back or forward button after an anchor has been set. ...
5
by: Randy Webb | last post by:
The list below has the current section number, proposed anchor name, and then the current title of that section. Some make sense, some don't. There are a few that don't have proposed anchor names...
3
by: Bjorn Nordbo | last post by:
Hello, I have a page with a vertical list of photos separated with bits of text. Using page down to view the photos is a bit annoying as it will typically cut the photos as it only jumps a...
20
by: Prisoner at War | last post by:
Hi, People, Is it possible to have an "empty" or "dummy" <a href***without*** the browser jumping back up the page?? I have a hyperlink that doesn't point to another document, but is used to...
1
by: praveenb000 | last post by:
Hi every one, I designed a web page, having horizontal menu using UL and LI tags; I need to be set rollover effect for a menu items. whenever user hover on a menu item, the entire...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.