Cycle Plugin & JQuery.Preload
HELP ME PLEASE!!!!
The following (JQuery.Preload coupled with the cycle plugin)does exactly what I wanted in Firefox (preload images with a fancy-schmancy loading .gif before showing the cycle), but in IE it's pure crap.
Please help me sort this out.
-
<script type="text/javascript">
jQuery(function( $ ) {
$('#loading').fadeIn('fast');
$.preload( '#gal img', {//the first argument is a selector to the images
onRequest:request,
onComplete:complete,
onFinish:finish,
placeholder:'images/1.jpg',//this is the really important option
notFound:'/images/2.jpg',//optional image if an image wasn't found
threshold:1 //'1' is the default, how many at a time, to load.
});
function update( data ){
$('#done').html( ''+data.done );
$('#total').html( ''+data.total );
$('#loaded').html( ''+data.loaded );
$('#failed').html( ''+data.failed );
};
function complete( data ){
update( data );
$('#image-next').html( 'none' );//reset the "loading: xxxx"
$('#image-loaded').html( data.image );
};
function request( data ){
update( data );
$('#image-next').html( data.image );//set the "loading: xxxx"
};
function finish(){//hide the summary
$('#loading').fadeOut(500);
$('#gal').fadeIn(1500);
};
$('#gal')
.after('<div id="picnav">')
.cycle({
fx: 'fade',
speed: 800,
pager: '#picnav'
});
});
</script>