You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
wouldn't help at all because document.readyState == 'interactive' is basically DOMContentLoaded, so we should explicitly check for complete, other than that it's a pretty fair request.
@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 document.readyState == 'interactive' should be enough.
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.
Activity
Merg1255 commentedon Jul 3, 2014
With the customizer you can combine all the plugins you need from BS. Are you referring to other plugins?..
bassjobsen commentedon Jul 3, 2014
@Merg1255 no i refer to the BS plugins
hnrch02 commentedon Jul 3, 2014
wouldn't help at all because
document.readyState == 'interactive'is basically DOMContentLoaded, so we should explicitly check forcomplete, other than that it's a pretty fair request.bassjobsen commentedon Jul 3, 2014
@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
document.readyState == 'interactive'should be enough.jQuery should be finished loading before loading the plugins, but this dependency check should be done elsewhere i think.
hnrch02 commentedon Jul 3, 2014
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.
mdo commentedon Aug 4, 2014
Probably something to tackle in v4 if we want to do this at all @fat?
fat commentedon Aug 15, 2014
yeah we can look into it for v4, think it makes sense
mdo commentedon Aug 23, 2014
Added to the list.