jquery-scroll
jquery-scroll copied to clipboard
Images
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!