Forum Moderators: open

Message Too Old, No Replies

Script to toggle style

         

field4000

10:17 am on Feb 15, 2005 (gmt 0)

10+ Year Member



Hey,
I am trying (but not having too much luck) to toggle a style for a navigation item while hovering over a separate layer.

What I have done so far: a list (i.e. ul) driven navigation with a sub-menu on a separate layer. When one rolls over one of the navigation items (i.e. li) the opacity on the item reduces to 50% and toggles the sub-menu layer.

What I am having trouble with: trying to retain the opacity of the ‘rolled over’ item on the menu whilst the mouse is hovering over the sub-menu layer.
Sorry if this is unclear.

What I want to do: somehow use javascript to toggle the style that makes the list item opaque (I already have to required style - I just have to toggle it in the sub menu layer).

Thanks in advance.

orion_rus

10:37 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



I don't understand u clear( sorry my English is bad by i try to explain what i got.
u have a style
<style>
.newstyle
{filter:alpha(opacity=65);
-moz-opacity:0.65;}
//this style means what u have ur layer with .newstyle 65% opacity for IE and Mozilla browser
.darkstyle
{filter:alpha(opacity=100);
-moz-opacity:1;}
// this is a usual css style
then something happend like onclick or onmouseover u can simple change i style
like this.className="darkstyle" and u get object with 100% opacity
i hope i understand u right, if not correct me pls)
Good luck to you

SpaceFrog

8:48 am on Feb 16, 2005 (gmt 0)

10+ Year Member



changing className works fine..
I have seen another method that consists in changing id
and having specific styles per id

#idone {...

#idtwo {...


changing id therefore toggles style ...

just another idea