Use mouseover and oncolor code for non-menu items

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Angus
Beginner
Beginner
Posts: 6
Joined: Thu Jul 01, 2004 2:54 pm

Use mouseover and oncolor code for non-menu items

Post by Angus »

Hi, I'm wondering if I can tap into the mouseover code and the code that checks what page is currently loaded and use them for other parts of my page.

1. Aside from the menus, I have a side nav section that I'd like to have automatically change the oncolor the way the menus do.

2. It seems like it should be easy to tap into the mouseover function and use it on the other mouseovers on my page.

thanks
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm not sure about 'tapping' into the menu function for that, but you can do it with css style. i.e.

Code: Select all

<style>
a:hover{color:#ff0000; }
</style>
That would turn the text red when you had the mouse over it. You can also put a lot of other options. You could add to that code background-color:#ffffff; that would make the text red and the background of that link white when the mouse was over it. Alternatively, why not make that side nav menu another milonic menu? You can actually do it from the data file you have now, just create a new menu, set it's position top and left where you want it and set it to always visible, then you can use all the functions of the menu. :D

Ruth
Angus
Beginner
Beginner
Posts: 6
Joined: Thu Jul 01, 2004 2:54 pm

Post by Angus »

Hi, thanks for the input. I'm afraid I didn't explain it well enough. I've got some mouseovers that aren't really part of the menu, so I added my own mouseover code. It seemed silly to have two different mouseover functions. I thought I might as well use the Milonic one, even though it wasn't for a menu.

As for the left nav, I did consider making it a second menu, but I've turned off the Netscape 4 version of the menus, so NN4 users wouldn't be able to get around. They can get around without the menus now by relying on the left nav.

Since that isn't an option, I though I could at least make use of that part of the menu that detects which page is current, and changes the color of the link as a result. Any idea how to call that function?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm sorry, I don't. Someone more knowledgeable with the program and javascript might. But, just so you know there is an option to use the menu in the left nav and also have the NS4 users keep what they have. Here's a link to the relevant POSTS. You'll kind of have to go through the posts, there are some other things in the topic as well. The person doing it also shut off the netscape 4 version, has a code that writes the nav links behind the version 5 and a code that keeps 5 from showing if the person comes using netscape 4. Seems to work really well. I have netscape 4.79 for testing purposes :)

Ruth
Angus
Beginner
Beginner
Posts: 6
Joined: Thu Jul 01, 2004 2:54 pm

Post by Angus »

Thanks again, I'll check those posts out. They look like they might solve a NN4 page loading problem I've been having too!
Post Reply