ressio / lazy-load-xt

Lazy load XT is a jQuery plugin for images, videos and other media
http://ress.io/lazy-load-xt-jquery/
MIT License
1.36k stars 245 forks source link

how to load image on jquery UI tab #115

Open amouratoglou opened 6 years ago

amouratoglou commented 6 years ago

Hi guys

I have an image that is located inside a tab -jquery UI- when I open the tab, it shows the tab, and the spinner doesn't disapear. image "loads" when I click, or switch the tab, resize viewport. but doesn't change if I leave it untouched. Scrolling doesn't make it show either.

I have tried to trigger it using jQuery on click, but doesn't work:

jQuery(.image_class).lazyLoadXT({show:true});

I have found a workaround, but I guess is not the best.


    setTimeout(function() {
        jQuery(".show_image .lazy-extended").trigger("click");
    }, 1000);  

Just trigger a click on the lazy image with a callback function.

thanks