Jump to content


Banner Changer Script


1 reply to this topic

#1 DJayAA

    Young Padawan

  • Members
  • Pip
  • 28 posts
  • Gender:Male
  • Location:New Jersey

Posted 06 December 2007 - 11:26 AM

Hello Everyone,

I am trying to setup a script (Javascript I believe) that will allow users on my site see 4 - 5 thumbnail sized boxes with different images or colors in them. When they click on the small image it will update the banner instantly. For example, I want the logo to stay there, but have the background of the banner change to whatever the image is they click (leaves, snow, trees, colors). If anyone can help me out with this or point me in the right direction of what I should be looking for I would greatly appreciate it.

#2 Wildhoney

    Young Padawan

  • Members
  • Pip
  • 31 posts

Posted 07 December 2007 - 01:50 PM

Please see the attached document. To replace the background colours with images, simply use:

var szImage = pThis.getAttribute('src');
document.getElementById('image').setAttribute('src') = szImage;

That will take the image from the thumbnail and place it into the bigger image, with the white DIV still on the top which I imagine you want to swap with an image anyway.

Hope this helps you.

Attached Files







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users