Wednesday, September 23, 2009

Another way to preload images in javascript

function preloadImg(url) {
var divPreLoad = '<div style="height:0px; width:1px; background-image:url(' + url + ')"></div>';
document.write(divPreLoad);
}

No comments:

Post a Comment