ebiwd / EBI-Framework

The EMBL-EBI Visual Framework for websites and services.
https://www.ebi.ac.uk/style-lab/websites/
19 stars 16 forks source link

Fix window position when linking to anchors #122

Closed khawkins98 closed 6 years ago

khawkins98 commented 6 years ago

We already compensate the scroll position when clicking on in-page anchor links foundationExtendEBI.js#L278, but when you follow a link the anchor often winds up either close to the top or tucked on the sticky menu; http://tsc.ebi.ac.uk/article/health-and-safety-policy-embl-ebi#Section_12_Animals :

image

It's confusing.

We can repurpose our smoothscroll link in foundationExtendEBI.js to detect anchors on page load and set the viewport appropriately.

khawkins98 commented 6 years ago

This one is now done.