突出显示asp.net中的当前锚标记 [英] Highlight the current anchor tag in asp.net
本文介绍了突出显示asp.net中的当前锚标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在html中创建一个带有list标签的菜单栏。在list标签内我使用了锚标签。点击每个锚点我正在更新网格视图数据源。我需要突出显示当前的锚标记。你可以帮我这么做吗?
解决方案
你好,
你可以通过手动完成,这意味着您需要使用类(css)来区分活动和非活动标签,
。 active
{
color : 红色;
/ * 使用任何样式突出显示* \
}
.inactive
{
color:black;
}
点击标签时首先删除所有标签的class属性
( a)。removeClass( active inactive) ;
然后通过
<添加特定点击标签的课程/ blockquote>
( #a_clickedid)。addClass( active);
谢谢
Magesh M
I am trying to create a menu bar with list tag in html. Inside the list tag i have used the anchor tag . On clicking each anchor i am updating the grid view data source . I need to highlight the current anchor tag . Can you please help me in doing that ?
解决方案
Hi,
You may do this by manually, that means you needs to use to classes(css) to differentiate active and inactive a tag ,
.active { color:red; /* use any style to highlight *\ } .inactive { color:black; }
while clicking in a tag first remove the class property of all a tag
( "a" ).removeClass("active inactive" );
then add class to particular clicked a tag by
( "#a_clickedid" ).addClass("active" );
Thanks
Magesh M
这篇关于突出显示asp.net中的当前锚标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文