A miracle if someone knows the exact cause of this problem!
I am changing an image on resize, onLoad, etc. The image is in a table with 6 other images inside a div. I place all the images in an array, then clone the images(true) then set the clone.src to the original image.src(I do this so I will always set my height and width ratio to the original image size and not the one set on resize, this stops image from becoming distorted). Now when I change the src on image name p00001.gif it alters the size(before I do with javascript).
Also I wanted to avoid creating a new element because I am using the same function to load a larger version of the image into a pop.window(different frame).
Changing the .gif name of another file to p00001 also cause error as well as changing src. I tried many names similar to p00001.gif an none cause this error. I even open the .gif in an editor to see if something was wrong or a gif had a header with some paramaters causing this error.
For now I've only tested it on IE. Below is the code.
Note:to clear up the code I do the ratio of width to screen width to see which is bigger width or heigh ratio. I then size the image according to with is bigger w or h ratio.
function setDivCur(el)
//el is id of div containing images
{
var imgAry=document.getElementById (el.id).getElementsByTagName('img');
for (i=0; i<imgAry.length;i++)
{
var nImg=imgAry[i].cloneNode(true);
nImg.src=imgAry[i].src;
var d1=(sW*.12)/nImg.width;
//sW is document window width
var d2=(sH*.12)/nImg.height;
//sH is document window height
var myR=(d1<d2)?d1:d2;
='+nImg.height+'width= '+nImg.width);
nImg.width=myR*nImg.width;
nImg.height=myR*nImg.height;
imgAry[i].parentNode.replaceChild(nImg,imgAry[i]);
}
}
Anyone have any clue, I searched the net and found nothing.