Skip to content

Comments

fix: defer Scrollex initialization until AngularJS renders sections #85

Closed
lakshay776 wants to merge 1 commit intom-lab:mainfrom
lakshay776:issue-42
Closed

fix: defer Scrollex initialization until AngularJS renders sections #85
lakshay776 wants to merge 1 commit intom-lab:mainfrom
lakshay776:issue-42

Conversation

@lakshay776
Copy link
Contributor

@lakshay776 lakshay776 commented Feb 19, 2026

  • Moved the existing Scrollex setup into a separate initScrollex() function for better control over when it runs.
  • Added a lightweight check that looks every 100 ms to see if AngularJS has finished loading the sections (#intro, #about, etc.) into the page.
  • As soon as those sections appear, initScrollex() runs and the check stops automatically.
  • Nothing about Scrollex itself was changed — only the timing was adjusted so it doesn’t run before the elements exist.
var attempts = 0;
var maxAttempts = 50;
(function waitForSections() {
    if ($('#intro').length > 0 || $('#about').length > 0) {
        initScrollex();
    } else if (attempts < maxAttempts) {
        attempts++;
        setTimeout(waitForSections, 100);
    }
})();

fixes #42

@lakshay776 lakshay776 changed the title fix: defer Scrollex initialization until AngularJS renders sections (#42) fix: defer Scrollex initialization until AngularJS renders sections Feb 19, 2026
@lakshay776
Copy link
Contributor Author

@robertodauria I have implemented a fix for this issue. Kindly review and give your feedback!

@robertodauria
Copy link
Contributor

robertodauria commented Feb 20, 2026

Thanks for the contribution. Closing this as it is superseded by #83, which rewrites the codebase removing Angular, jQuery, Gulp, and the old app/ directory structure. The files modified by this PR either no longer exist after that change or the change has already been made.

We aim to merge #83 next week, which will give contributors a stable, modern base to work from. Thoughtful, targeted contributions that build on where the project is heading are much more valuable. We'd encourage you to review #83 and open any future PRs on top of that.

@lakshay776
Copy link
Contributor Author

@robertodauria Thanks for letting me know about this! Will surely wait for the #83 to be merged to make any further contributions in this repo. Meanwhile I'll review the #83 and let you know my suggesstions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

$section in main.js is evaluated before its corresponding element exists in the DOM

2 participants