突出显示所选菜单项dotnetnuke

时间:2023-01-19 08:49:23
<%@ Register TagPrefix="dnn" TagName="LINKS" Src="~/Admin/Skins/Links.ascx" %>

<dnn:LINKS runat="server" id="LINKS1" CssClass="MenuLink" Alignment="Horizontal"
            Level="Root" ForceLinks="False" />

I have the following code to produce the menu item in my dotnetnuke site. I need to change the selected menu item color or apply a different css so the user knows where they are on the site. I tried doing this using jquery by going to Page Settings and under the Page header tag. It doesn't do anything. How would I be able to highlight or apply a different css to the selected menu item?

我有以下代码来生成我的dotnetnuke网站中的菜单项。我需要更改所选的菜单项颜色或应用不同的CSS,以便用户知道它们在网站上的位置。我尝试使用jquery,通过转到页面设置和页面标题标记。它没有做任何事情。如何突出显示或将不同的CSS应用于所选菜单项?

I will appreciate for your guys help on this.

我很感激你的帮助。

2 个解决方案

#1


0  

I was able to fix this from the help of the url below.

我能够在下面的网址的帮助下解决这个问题。

jquery to change the background color of a current page

jquery更改当前页面的背景颜色

#2


0  

It's probably too late, but DNN applies the ".sel" CSS style dynamically to the currently selected menu item.

这可能为时已晚,但DNN将“.sel”CSS样式动态应用于当前选定的菜单项。

There's a PDF floating around the DNN site somewhere which details it (really hard to find), or use developer tools (F12 in IE, or Firebug in Firefox, etc) to view the styles applied to each menu item.

在DNN网站的某处有一个PDF,它详细说明了它(很难找到),或者使用开发者工具(IE中的F12或Firefox中的Firebug等)来查看应用于每个菜单项的样式。

So add to your CSS something like:

所以添加到你的CSS之类的东西:

.sel {
    color: #ABCDEF;
}

EDIT: Sorry, this applies the Nav Menu skin object. Which it might be better to use as you have more styling options.

编辑:对不起,这适用于Nav Menu外观对象。哪个可能更好用,因为你有更多的样式选项。

#1


0  

I was able to fix this from the help of the url below.

我能够在下面的网址的帮助下解决这个问题。

jquery to change the background color of a current page

jquery更改当前页面的背景颜色

#2


0  

It's probably too late, but DNN applies the ".sel" CSS style dynamically to the currently selected menu item.

这可能为时已晚,但DNN将“.sel”CSS样式动态应用于当前选定的菜单项。

There's a PDF floating around the DNN site somewhere which details it (really hard to find), or use developer tools (F12 in IE, or Firebug in Firefox, etc) to view the styles applied to each menu item.

在DNN网站的某处有一个PDF,它详细说明了它(很难找到),或者使用开发者工具(IE中的F12或Firefox中的Firebug等)来查看应用于每个菜单项的样式。

So add to your CSS something like:

所以添加到你的CSS之类的东西:

.sel {
    color: #ABCDEF;
}

EDIT: Sorry, this applies the Nav Menu skin object. Which it might be better to use as you have more styling options.

编辑:对不起,这适用于Nav Menu外观对象。哪个可能更好用,因为你有更多的样式选项。