jquery-scroll icon indicating copy to clipboard operation
jquery-scroll copied to clipboard

Images

Open tsukasa1989 opened this issue 13 years ago • 0 comments

The plugin does not update when images are loaded, if some handler could call a repaint when an image is loaded within the container, then a scrollbar should aprear.

I'm currently using this function:

// If the scrollbar contains image, we need to wait for those
$(".scrollbar").each(function(){
    var len = $(this).find("img").length;
    if(len > 0)
    {
        var _this = $(this).data("imgloaded", 0);
        $(this).find("img").each(function(){

            this.onload = function()
            {
                _this.data("imgloaded", _this.data("imgloaded") + 1);
                if(_this.data("imgloaded") == len)
                {
                    _this.scrollbar({
                            arrows : false
                          });       
                }
            }

            // Reset the SRC to catch onload
            var src = this.src;
            this.src = "";
            this.src=src;
        });
    }
    else
    {
        $(this).scrollbar({
                            arrows : false
                          });   
    }
});

Thanks for the great work!

tsukasa1989 avatar Dec 20 '11 11:12 tsukasa1989