Im using a preloader to load large images before I display them.. I am using this script:
http://davidwalsh.name/mootools-image-preloading-progress-bar
I want to make it disappear when it reaches 100% loaded. I have modified the script by adding
progressBar.set(0);
to the onComplete function at the bottom of the page. However, now the loader just fails to appear at all. How do I get the loader to disappear when it reaches 100%? Any ideas? Here is the rest of the script:
window.addEvent('domready', function() {
var progressBar = new dwProgressBar({
container: $('progress-bar'),
startPercentage: 0,
speed:750,
boxID: 'box',
percentageID: 'perc',
displayID: 'text',
displayText: false
});
var images = ['http://designvillain.com/logo_big3.jpg'];
var loader = new Asset.images(images, {
onProgress: function(counter,index) {
progressBar.set((counter + 1) * (100 / images.length));
},
onComplete: function() {
images.each(function(im) {
new Element('img',{ src:im, style:'' }).inject($('images-holder'));
});
}
});
});