arothman
06-18-2003, 10:43 AM
Ok, here's the situation... I've got a standard javascript rollover menu in the left frame, and the content in the right. What I want is for the menu item to remain highlighted when the page loads, so the visitor knows which page they are looking at. I've partially handled it, but I'm somewhat stuck.
Basically, I've got and onload script on each page that tells the menu frame to highlight the proper menu image:
onload="if(parent.menuframe.document.images)
{parent.menuframe.document.menu_01.src='images/menu/menu_01-over.gif'}"
And I've got code in the menu page that tells the rollover to disable itself if the page has triggered it:
function changeImages() {
if (document.images && (preloadFlag == true))
{
for (var i=0; i<changeImages.arguments.length; i+=2)
{
if(changeImages.arguments[i]!=highlighted){
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
-----------------
<A HREF="attorneys.html" TARGET="content"
ONMOUSEOVER="changeImages('menu_01', 'images/menu/menu_01.gif', 'menu_02', 'images/menu/menu_02.gif', 'menu_03',
'images/menu/menu_03.gif', 'menu_04', 'images/menu/menu_04.gif', 'menu_05', 'images/menu/menu_05-over.gif', 'menu_06', 'images/menu/menu_06.gif',
'menu_07', 'images/menu/menu_07.gif'); return true;"
ONMOUSEOUT="changeImages('menu_05', 'images/menu/menu_05.gif'); return true;">
<IMG NAME="menu_05" SRC="images/menu/menu_05.gif" WIDTH=221 HEIGHT=40 BORDER=0></A>
So my problem now is how to tell the menu that a NEW page has loaded and that it's ok to UN-highlight the image again. Right now, the image highlights, but then stays lit, which doesn't really make for clear navigation. :)
To see the code in action, check out the preview area of the site (http://www.collaborativefamilylaw-mo.com/preview.html)
Thanks in advance to anyone who can help!
Drew
Basically, I've got and onload script on each page that tells the menu frame to highlight the proper menu image:
onload="if(parent.menuframe.document.images)
{parent.menuframe.document.menu_01.src='images/menu/menu_01-over.gif'}"
And I've got code in the menu page that tells the rollover to disable itself if the page has triggered it:
function changeImages() {
if (document.images && (preloadFlag == true))
{
for (var i=0; i<changeImages.arguments.length; i+=2)
{
if(changeImages.arguments[i]!=highlighted){
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
-----------------
<A HREF="attorneys.html" TARGET="content"
ONMOUSEOVER="changeImages('menu_01', 'images/menu/menu_01.gif', 'menu_02', 'images/menu/menu_02.gif', 'menu_03',
'images/menu/menu_03.gif', 'menu_04', 'images/menu/menu_04.gif', 'menu_05', 'images/menu/menu_05-over.gif', 'menu_06', 'images/menu/menu_06.gif',
'menu_07', 'images/menu/menu_07.gif'); return true;"
ONMOUSEOUT="changeImages('menu_05', 'images/menu/menu_05.gif'); return true;">
<IMG NAME="menu_05" SRC="images/menu/menu_05.gif" WIDTH=221 HEIGHT=40 BORDER=0></A>
So my problem now is how to tell the menu that a NEW page has loaded and that it's ok to UN-highlight the image again. Right now, the image highlights, but then stays lit, which doesn't really make for clear navigation. :)
To see the code in action, check out the preview area of the site (http://www.collaborativefamilylaw-mo.com/preview.html)
Thanks in advance to anyone who can help!
Drew