如何更改菜单项的颜色?

编程入门 行业动态 更新时间:2024-10-28 01:12:59
本文介绍了如何更改菜单项的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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上查看这篇文章 菜单控制所选项目颜色更改取决于选择 [ ^ ] 并查看这些帖子 forums.asp/t /1472219.aspx?Change+background+color+of+current+page+in+Menu+bar [ ^ ] stackoverflow/questions/18317923/how - 用户点击网络链接改变菜单栏 - [a href =stackoverflow/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 forums.asp/t/1472219.aspx?Change+background+color+of+current+page+in+Menu+bar[^] stackoverflow/questions/18317923/how-to-change-a-colore-of-menu-bar-when-user-click-on-net-link[^]

更多推荐

如何更改菜单项的颜色?

本文发布于:2023-08-06 03:35:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1309790.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:菜单项   如何更改   颜色

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!