简体   繁体   中英

Preload JS file or load images last

Hi I have a slider which uses bxslider as a plugin and the images load before the javascript therefore there is a moment before the JS file has loaded but before the images have where there is display issues. How can I fix this?

http://orchid-goose.cloudvent.net/

put the implementation of the slider in

$(window).on("load", function() {
    // weave your magic here.
});

That function will be executed, when all data was loaded

Set css property visibility:hidden for the slider and make it visible once the script has finished loading. You can have a placeholder image as background in the parent container, eg a gif indicating it is loading.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM