Click to See Complete Forum and Search --> : Need help with somewhat complex rollover...


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

Khalid Ali
06-18-2003, 11:11 AM
Its basically the design choice of yours.
What you can do is reload the menu page with udated info as soon as you have the different page in the contents page..or run a setTimeout routine in menu page to always look for any changes in the content page.

arothman
06-18-2003, 11:23 AM
Hi Khalid... thanks for the speedy response!

Since I basically built the menu from Imageready and help from some friends, I'm really not sure how to do either of the things you suggested. :)

I guess the timeout script would be the most elegant method... any tips on where I'd find that sort of code? I'm still learning!

Thanks,
Drew

Khalid Ali
06-18-2003, 12:39 PM
You might have to pst a lin to your pages for me to see how is the rest of
the logic to suggest a scripted solution..or you can do google search with the following phrase
"setTimeout ()"

I got 103,000 results..lol

David Harrison
06-18-2003, 12:58 PM
I can't think of the code just off the top of my head but, rather than reloading the navigation frame wouldn't it be better to detect the name of the page in the content frame and then disable (and also "highlight") the corresponding link.

arothman
06-18-2003, 01:43 PM
Thanks guys...

There actually is a link to the page in my original post, right near the bottom.

I'll check out google for the timeout script and see if I can learn something.

Drew