Click to See Complete Forum and Search --> : grr, im about to throw my comp out the window...


Da Warriah
12-29-2002, 01:59 PM
alright, ONCE AGAIN im here, asking another question...it should be SO EASY, but its not working!!! :mad:

alright, i have some links set up that change skins on my forum, and what i need to do is set up a function so that if you click one of the links, it will change my logo to target a different src...and if you click any of the other skin links, it will change it back to the original...this should be so easy, but nothing i try works...any ideas here???

AdamGundry
12-29-2002, 02:23 PM
You can give a name/id to the image, using

<img name="logo" id="logo" src="logo1.gif">

Then change it in the hyperlink's onClick event handler:

<a onclick="logo.src = 'logo2.gif'">Change to logo 2</a>
<a onclick="logo.src = 'logo1.gif'">Back to logo 1</a>

This will only work, however, if the user remains on the same page and doesn't refresh. When they change pages, the image will reset to that specified in the source, unless you use cookies or server-side scripting.

Adam