Skip to content

Instantly share code, notes, and snippets.

@kathgironpe
Created October 25, 2009 17:29
Show Gist options
  • Save kathgironpe/218142 to your computer and use it in GitHub Desktop.
Save kathgironpe/218142 to your computer and use it in GitHub Desktop.
jQuery Cycle - Display Loading Message if Images Are not Loaded
$(document).ready(function($) {
$('#gallery-slideshow, .gallery-controls').hide();
$('#loading').show();
var last_slide = $('#gallery-slideshow li img:last');
var last_image_attr = last_slide.attr("src");
last_slide.onImagesLoad({
itemCallback: itemImagesLoaded
});
function itemImagesLoaded(){
$('#gallery-slideshow, .gallery-controls').show();
$('#loading').hide();
$('#gallery-slideshow').cycle({
fx: 'fade',
speed: 'fast'
});
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment