Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images #18

Open
tsukasa1989 opened this issue Dec 20, 2011 · 0 comments
Open

Images #18

tsukasa1989 opened this issue Dec 20, 2011 · 0 comments

Comments

@tsukasa1989
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant