/    Sign up×
Community /Pin to ProfileBookmark

Highlighting top menu while the submenu is displayed

Hi

I have set of top menu and on mouseover on these menus their corresponding submenus will be displayed. This works perferect. What i needed is when the user mouseover the top menu the menu color should be changed and this is also working fine (i am doing this using CSS, a:hover property). But once i move my mouse out of top menu and navigate to it’s submenu, the hightlighting is gone. But i want the highlight to remain same till the user is using it is submenu. What should i do to retain the highlight.

thanks

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@opifexNov 17.2009 — example of what isn't working?

hard to see what you want not seeing what you have.
Copy linkTweet thisAlerts:
@samsonkiranauthorNov 17.2009 — Hi

Thank you for your reply. This is how i am displaying my menus & submenus

<li><a href="#" onmouseover="<c:out value='showMenu('Menu1')' escapeXml='false'/>" onmouseout="hideMenu('Menu1')" escapeXml='false'/>"><span>Menu1</span></a></li>

I have a the javascript, using which i'll add the submenus for each and every top menu and as it is shown in the above example, on mouseover the top menu i call the method showMenu in my javascript to display the corresponding submenu.

And my CSS has the below styling to style the topmenu on mouseover

a:hover

{

color:#039ED8 !important;


background:#BABCB9;


text-decoration: none;


width: 100px;

}

a:hover span

{

color:#039ED8 !important;


background:#BABCB9;

text-decoration: none;


padding-bottom:4px;

}

when i mouseover the topmenu it gets highlighted with grey background and also displays the submenus. But when i try to navigate to one of the submenu i.e just moving the mouse to one the submenu the grey background is gone. But i wanted the grey background to remain if the user is on the submenu. Hope this helps.

Thanks
Copy linkTweet thisAlerts:
@opifexNov 17.2009 — with only seeing this i would say that the answer is in your javascript... and suggest to get rid of it and uses a pure css solution.

no one will be able to see the real problem without a more or less complete example... that includes the javascipt! the best way is to put a test page on line and link to it.
×

Success!

Help @samsonkiran spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...