我们使用母版页时如何突出显示HTML菜单 [英] How the HTML Menu will be highlighted when we used the Master Page
问题描述
亲爱的专家,
我正在做一个asp.net(C#3轮胎)项目,并且正在使用Master。在母版页中,html - CSS菜单就在那里..
当我选择菜单时,它会突出显示。但是如果我们想要突出显示菜单我想为该html标签添加一个类名..这是下面的例子......
Dear Experts,
I am doing a asp.net (C# 3 tire) project, and am using Master. In master page, html - CSS menu is there..
And when i select a menu, then it will be highlighted. But if we want the menu highlighted i want to add a class name to that html tag.. here is the below example...
<li class="current"><a href="index.html" class="shortcut-dashboard" title="Dashboard">Dashboard</a></li>
此处添加当前类。所以它会突出显示...
我的查询是...
怎么可能动态这个.... ??
我的菜单在主页面中..?怎么可能.. ??
有没有Javascript或其他方式.. ??
请帮我解决这个问题....
谢谢和问候,
Dileep
Here Class "Current" is added . so it wil be highlighted...
And my query is...
How can be dynamic this....??
My menu is in the Master Page..? so how is it possible..??
Is there any Javascript or some other way..??
Please help me to solve this problem....
Thanks and Regards,
Dileep
推荐答案
你可以在JQuery中完成..
You can do it in JQuery..
( a.shortcut-dashboard)。on( 点击,function(){
if (!
("a.shortcut-dashboard").on("click",function(){ if(!
( a.shortcut-dashboard)。parent ()。hasClass( current))
("a.shortcut-dashboard").parent().hasClass("current"))
这篇关于我们使用母版页时如何突出显示HTML菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!