So I have this script on a website i'm working on, which basically loads images from a database and puts them in a div. When all the images are loaded, I want it to fire a scroller plugin (smoothdivscroll). But I can't find a way to make the last part work.
Here is the code:
$.get("pages/photosgigs.php", { gig: $(this).attr("id")}, function(data) {
$('#makeMeScrollableGall').html(data)
$(window).load( function() {
$("#makeMeScrollableGall").smoothDivScroll();
resize();
});
});
The php script on photosgigs.php returns a simple <img class="photo" src="..." />
. I've also tried it with $("img.photo").load()
which, although I know it would fire when the first image is loaded, also doesn't work. Also tried $("#makeMeScrollableGall").load()
, doesn't work either.
I'm beginning to think my problem lies in the fact that my images are loaded dynamically. Is this correct?
Or am I just being a plain retard and am I doing everthing wrong?