Delay image loading with jQuery

后端 未结 4 1167
攒了一身酷
攒了一身酷 2020-12-04 14:36

I have a page with several galleries including accordions and sliders. The problem is that the page takes forever to load. Is there a way of wrapping an image in a bit of

4条回答
  •  攒了一身酷
    2020-12-04 15:27

    Keep only one image into the HTML so that viewer has something to start with, then inject the rest using jQuery with

    $(document).ready(function() {
        //load rest of the images
    });
    

    You can also use event loaders and AJAX or "load as you go", just build a simple call back function if it's auto-rotating gallery or load on click.

提交回复
热议问题