11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

{<br />

}<br />

var abouton = new Image();<br />

abouton.src = "abouton.gif";<br />

var aboutoff = new Image();<br />

aboutoff.src = "aboutoff.gif";<br />

// ... possibly more buttons ...<br />

var blank = new Image();<br />

blank.src = "blank.gif";<br />

var description1 = new Image();<br />

description1.src = "description.gif";<br />

// ... possibly more descriptions ...<br />

/* Turns the given image on and at the same time shows the description<br />

*/<br />

function on(imgName, description)<br />

{<br />

if (document.images)<br />

{<br />

}<br />

imgOnSrc = eval(imgName + "on.src");<br />

document.images[imgName].src = imgOnSrc;<br />

document.images["descriptionregion"].src = description.src;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!