Hilfe durchsuchen

Vorsicht vor Support-Betrug: Wir fordern Sie niemals auf, eine Nummer anzurufen, sie per SMS zu kontaktieren oder persönliche Daten preiszugeben. Bitte melden Sie verdächtige Aktivitäten über die Funktion „Missbrauch melden“.

Learn More

Probable very small error in Firefox

  • 4 Antworten
  • 1 hat dieses Problem
  • 10 Aufrufe
  • Letzte Antwort von jscher2000

more options

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

Alle Antworten (4)

more options

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();
  }
});

Hilfreich?

more options

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.

Hilfreich?

more options

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

Hilfreich?

more options

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

https://bugzilla.mozilla.org/

Hilfreich?

Stellen Sie eine Frage

Sie müssen sich mit Ihrem Benutzerkonto anmelden, um auf Beiträge zu antworten. Bitte stellen Sie eine neue Frage, wenn Sie noch kein Benutzerkonto haben.