Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Probable very small error in Firefox

  • 4 பதிலளிப்புகள்
  • 1 இந்த பிரச்சனை உள்ளது
  • 10 views
  • Last reply by jscher2000

Hello,

I think I have discovered a hidden, rather small error in Firefox.

If I load my website: ECstep.com (the homepage of my site) and click the cholesterol picture or the trans fat picture, you should go to: https://ecstep.com/fat/#cholesterol or https://ecstep.com/fat/#trans%20fats. respectively, but instead you go to the bottom of the https://ecstep.com/fat/ after a temporary glimpse of the right position on the page. However, if you click the fatty acids picture on the homepage you are transferred to the correct place: https://ecstep.com/fat/#fatty%20acids and stay there.

I have tried Google Chrome and Microsoft Edge and these browsers do not produce the same problem. For that reason I think the problem lies in Firefox and not in my website code.

I hope this information is useful to you.

Best regards,

Erik Christensen

All Replies (4)

Hi Erik, this problem is related to the toggle containers. When the document loads, the toggle containers are fully expanded, then a script collapses them later. But in between, Firefox has already calculated the vertical numerical position for the internal link you went to, and it does not recalculate the position after the upper part of the page is drastically shortened. Of course, this is only a problem for the links that are below the toggle containers.

This is a difficult situation to work around. One possibility is to add a snippet of script to the page that runs after the page has rendered and re-scrolls if needed. I'm not sure of the timing, whether it will run before or after the toggle containers are closed.

window.addEventListener('load', function(evt){
  var bmk = window.location.hash;
  if (bmk.length > 1){ // if there's a hash, scroll to it
    el = document.querySelector('a[name="' + bmk.substr(1) + '"]');
    el.scrollIntoView();
  }
});

Helpful?

Hi,

Thanks for the reply.

I am certainly not an expert on toggle containers, but it seems to me that Firefox calculates the vertical numerical position for the internal link prematurely, i.e. before the upper part of the page is shortened and the length of the page to be displayed is known

The vertical numerical position should probably be calculated after the length of the page to be displayed is known. I hope this gives some meaning.

Best regards,

Erik Christensen

P.S.

Helpful?

P.S. I just wanted to say that I like Firefox very much.

Helpful?

Hi Erik, you can file a bug report here and see whether Firefox can be changed later this year:

https://bugzilla.mozilla.org/

Helpful?

கேள்வி எழுப்பு

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.