I have a site similar to a photo gallery and Im taking large(er) images (i.e. - 600 pixels wide in JPEG format) and using the javascript below to generate thumbnails of the images with the proper height / width ratio... issue is, when the page loads, they (the images Im resizing) all flash at full size for fraction of a second then scale down to the thumbnail size...
Its quick, but if possible I'd like to HIDE the images using something like display: hidden or visibility: none until the resize is done... I havent had any success with it though, can someone tell me / show me how I might integrate some sort of 'hide' element to this script?
Its quick, but if possible I'd like to HIDE the images using something like display: hidden or visibility: none until the resize is done... I havent had any success with it though, can someone tell me / show me how I might integrate some sort of 'hide' element to this script?
Code:
function getThumb1()
{
var theImgWt1 = document.getElementById('randImageFile_1');
theImgWt1.width = theImgWt1.width / 4.3;
var theImgHt1 = document.getElementById('randImageFile_1');
theImgHt1.height = theImgHt1.height / 1.3;
}