Tuesday, August 7, 2007

Dynamically change background color of Header in Menu.

Set Background Color of Header in Menu

var Prev;
function HeaderFocus(curr)
// curr - Current menu to be painted.
{
if(Prev != null)
document.getElementById(Prev.id).style.background = 'transparent';
document.getElementById(curr.id).style.background = 'red';
Prev = curr; // Temporarily store current menu for next time modify.
}


No comments: