Thank you, I made this function modeled after that. However it's not working, is my syntax wrong?
hcur stores the id of the current element shown.
hx tells how many additional elements are included. (if theres more than one)
hcur + 'b' is the button, it changes images. hcur + '2', and hcur + '3' are additional elements that should be hidden/shown if needed.
Code:
function switchheader(id, x)
{
if ( hcur != id ){
document.getElementById(hcur).style.display = 'none';
document.getElementById(hcur + 'b').src = '/styles/7M-v1/new/' + hcur + '.png';
if (hx != 1){
document.getElementById(hcur + '2').style.display = 'none';
if (hx == 3){
document.getElementById(hcur + '3').style.display = 'none';}
}
hcur = document.getElementById(id);
document.getElementById(hcur).style.display = 'block';
document.getElementById(hcur + 'b').src = '/styles/7M-v1/new/' + hcur + '_alt.png';
if (x != 1){
document.getElementById(hcur + '2').style.display = 'block';
if (hx == 3){
document.getElementById(hcur + '3').style.display = 'block';}
}
hx = x;
}
}
Code:
<img onMouseover="switcheader('main', 2)" src="/styles/7M-v1/new/main.png" />
<img onMouseover="switcheader('projects', 1)" src="/styles/7M-v1/new/projects.png" /><td>
If anyone were to tell me what i'm doing wrong that would be greatly appreciated.
PS: Saw your message just now analog i'll make that change, however this code above isn't working at all.