-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defer loading of the javacripts plugins #14023
Comments
With the customizer you can combine all the plugins you need from BS. Are you referring to other plugins?.. |
@Merg1255 no i refer to the BS plugins |
document.readyState !== "loading" wouldn't help at all because |
@hnrch02, yes i doubt about that. But finally i think the plugins can initialize when the DOM has been loaded and don't have to wait for other resources. That is why i thought jQuery should be finished loading before loading the plugins, but this dependency check should be done elsewhere i think. |
Images and other resources that aren't loaded can affect the height of elements, so we could initialize all the plugins when the DOM is ready, but we would need to trigger a refresh for both Affix and ScrollSpy when everything has finished loading. I think it would be sufficient if we just change the current behavior to support post-load auto initialization via the data-api. |
Probably something to tackle in v4 if we want to do this at all @fat? |
yeah we can look into it for v4, think it makes sense |
Added to the list. |
The javascripts plugins such as affix and scrollspy use
$(window).on('load', function ()
for initialisation. When defer loading (after window.onload) jquery and / or the plugins, the onload event has already been fired before the code loads.For this reason i wonder if the plugin can be initialised with something like this:
The text was updated successfully, but these errors were encountered: