jordandap
10-03-2011, 11:13 AM
Hey guys i am test my page in IE8 and i have a small problem
the following script works in other browsers but not IE8
function preload(arrayOfImages)
{
$(arrayOfImages).each(function ()
{
$('<img />').attr('width', '100px').attr('height', '100px').attr('src',this).appendTo('#img').attr('class', 'img');
setTimeout(this, 2000);
});
}
when i run this with lets say 100 images and all the image sizes are all diffrent and above 150px*150px when this runs it will preload the images fine BUT it loads the images with their defualt width & height and not 100px*100px
any idea why this is?
the following script works in other browsers but not IE8
function preload(arrayOfImages)
{
$(arrayOfImages).each(function ()
{
$('<img />').attr('width', '100px').attr('height', '100px').attr('src',this).appendTo('#img').attr('class', 'img');
setTimeout(this, 2000);
});
}
when i run this with lets say 100 images and all the image sizes are all diffrent and above 150px*150px when this runs it will preload the images fine BUT it loads the images with their defualt width & height and not 100px*100px
any idea why this is?