Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q427

Feedback on: irt.org FAQ Knowledge Base Q427

Sent by RANCID on June 17, 2000 at 04:16:18: - feedback #1382

Comments:
Q427 How do I swap two images that are not of the same size?
CURRENT ANSWER:
You can't. Resize the images first, or add blank white space in the images to fill them out so that they are all the same size.
ADDENDUM:
You can. Omit the height and width specifications. (I use IE5 on W95)


Sent by Mike on Tuesday May 15, 2007 at 10:42:31 - feedback #4579

Worth:
Worth reading

Length:
Just right

Technical:
Just right

Comments:
var newImagePath = "myLargerImage.jpg";

// create a temp copy of the image to get the size (necessary for IE)
tempImage = document.createElement('img');
tempImage.setAttribute('src', newImagePath);

mainImage.setAttribute('src', newImagePath);
mainImage.setAttribute('width', tempImage.width);
mainImage.setAttribute('height', tempImage.height);




©2018 Martin Webb