如何更改菜单项的颜色? [英] How to change color of the menu item from being selected?

查看:119
本文介绍了如何更改菜单项的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我有一个横向菜单栏(主页,注册,关于我们)。现在,我想要的是当我在菜单中选择一个项目时,它会改变它的颜色,以便我知道我在哪个页面上工作。可以说,菜单栏的原始颜色是蓝色。当我在菜单栏中选择一个项目(注册栏)时,从蓝色它将变为绿色,其余菜单项(主页和关于我们)仍为蓝色。任何人都可以帮助我吗?

Hi guys!

I have a horizontal menu bar(Home,Register,About Us). Now, what I want is that when I selected an item in my menu, it will change its color so that I know on what page I am working with. Lets say, the original color of the menu bar is Blue. When I select an item (the Register bar) in the menu bar, from Blue it will turn to green, and the remaining menu items(Home and About Us) are still blue. Can anyone help me?

推荐答案

您可以使用javascript更改所选菜单项的颜色,也可以使用Session对象更改颜色



在codeproject上查看这篇文章

菜单控制所选项目颜色更改取决于选择 [ ^ ]



并查看这些帖子

< a href =http://forums.asp.net/t/1472219.aspx?Change+background+color+of+current+page+in+Menu+bar> http://forums.asp.net/t /1472219.aspx?Change+background+color+of+current+page+in+Menu+bar [ ^ ]



http://stackoverflow.com/questions/18317923/how - 用户点击网络链接改变菜单栏 - [a href =http://stackoverflow.com/questions/18317923/how- to-change-a-colore-of-menu-bar-when-user-click-on-net-linktarget =_ blanktitle =New Window> ^ ]
You can use javascript to change the color of selected menu item and also Session object to change the color

Check this article on codeproject
Menu Control Selected Item Color Change Depending on Selection [^]

and check these posts too
http://forums.asp.net/t/1472219.aspx?Change+background+color+of+current+page+in+Menu+bar[^]

http://stackoverflow.com/questions/18317923/how-to-change-a-colore-of-menu-bar-when-user-click-on-net-link[^]


这篇关于如何更改菜单项的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆