Skip to content

Images #18

@tsukasa1989

Description

@tsukasa1989

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions