View Single Post
09-13-2008, 04:57 PM
#6
xdoomx is offline xdoomx
Status: Member
Join date: Feb 2005
Location: Quebec, Canada
Expertise:
Software:
 
Posts: 441
iTrader: 1 / 100%
 

xdoomx is on a distinguished road

Send a message via AIM to xdoomx Send a message via MSN to xdoomx

  Old

This is what I would do :

PHP Code:
ShowImg = function(img){
    var 
background document.getElementById('background').style;
    var 
backstep 'url(images/bannerthin.png)';
    if(
imgbackground.backgroundImage='url(images/' img '.png)';
    else 
background.backgroundImage=backstep;
}; 
HTML Code:
<div id="background"></div>
<a href="#" id="1" onmouseover="ShowImg('banner')" onmouseout="ShowImg(null)">1</a>
<a href="#" id="2" onmouseover="ShowImg('text')" onmouseout="ShowImg(null)">2</a>
<a href="#" id="3" onmouseover="ShowImg('bannerthin')" onmouseout="ShowImg(null)">3</a>
One function that does it all, swaps the image if the parameter isn't null, resets it to default if it is.