Closed rhyslawry closed 7 years ago
Hmm unfortunately, there's no way to efficiently listen for a change in page height. The resize
event only applies to the browser window.
My ultimate goal is to refactor the jump-nav altogether so it has its own scrollbar. This would fix many issues and improve performance significantly. But in the meantime, a solution is to fire a custom event from the accordion and listen for it from the jump-nav. I'll do this now and improve a couple of other things.
Expected behaviour
Jumpnav should behave correctly on variable height pages, and listen for changes to page height
Actual behaviour
If a page has a variable height - e.g. uses accordions or other dynamic components The jumpnav will currently snap to the bottom of the page too early. It appears as though it is using the original height of the page in its calculations, and not considering when a page has changed its height after loading - e.g. an accordion has been opened
Steps to reproduce
See live example with accordions here: http://law.unimelb.edu.au/study/scholarships/prizes-awards
Screenshots:
(Note nav has snapped to bottom of page too early