onload vs ready

Created on 1 February 2024, 10 months ago
Updated 2 February 2024, 10 months ago

Problem/Motivation

When I load my page with a anchors in the URL, it happens (not consistently but pretty often) that the pages scrolls to the wrong place in the page. I guessed it might be because the anchors were loading before everything is in place in the page and I confirmed that by modifying the module code.
In auto_anchors.js on line 79, I replaced $(document).ready(function() { with $(window).on('load', function() { and that fixed the issue.

Proposed resolution

I would suggest that the anchors are created after every element is loaded or maybe an option is offered for the user to choose when the anchor creation should be triggered.

Thanks!

Feature request
Status

Needs review

Version

2.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024