English 中文(简体)
如何改进 asp. net mvc 3 网络应用程序的默认布局模板?
原标题:How can i improve the default layout template for my asp.net mvc 3 web application?

i 需要改进我 ASp. net mvc3 网络应用程序的默认布局模板中的以下内容。

<div id="logindisplay">
                @Html.Partial("_LogOnPartial")
            </div>
            <nav>
                <ul id="menu">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("Statistics", "Index", "Statistics")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                </ul>
            </nav>
        </header>
        <section id="main">
            @RenderBody()
        </section>

我想做的是:

  1. How i can change the colour of the currently selected <li>...</li> which is inside the <ul id="menu">. . which can help the users to recognize the web pages there are currently viewing.
  2. How i can add a sub menu which will be shown automatically when the user moves the mouse over a specific <li></li>. BR
最佳回答

You should implement the use of a different menu, there are lots out there! Check this link in order to find some JQuery menus.

哦,Btw,在第二个问题中,你需要的是一个叫做hover () () (http://api.jquery.com/hover/" rel="nofollow">learn 如何使用它)的 JQuery 函数,但别担心,这些菜单中也含有这种功能,只要得到其中之一并适应你的需求。

希望能帮上点忙!

问题回答

您可以以 < a href= > 创建多层站点映射“ https://github. com/ maartenba/ MvcSiteMapProvider” rel=“ nofollow” >MVCSiteMapProvider 。 这里是一个不错的 < a href=" http://edspencer. me.uk/2011/09/20/mvc-sc-scemitap- supportr-tumental-2- breadcrumbs/" rel=“ nofollow” > 来生成您启动的菜单。 它使用显示模板生成菜单, 您可以轻松的样式和变化 。

如果您更喜欢手工创建菜单, 并想要对当前选中的菜单项目进行样式, 请遵循此教程 : < a href=" http://derekreynolds. wordpress. com/2012/03/19 创建 - 活动流 - menu- unit- in- mvc3/" rel=" nofollow" > 在 MVC3 中创建活动菜单项目

最后一件事就是如何样式/ 动画您的菜单。 外面有无数的可用 JQuery 插件, 例如 < a href=> http://webdeignledger.com/resources/14- easi- to- com- com- com-resources/14- flap- down- menu- Solutions" rel= "nofollow"14 很容易执行下调菜单解决方案

我个人非常喜欢"http://twitter.github.com/bootsstrap/index.html" rel="nofollow" ,它 组件

<ul id="menu">
  <li class="current">Home</li>
<ul>

<style>
  .current{background:#000;}
</style>

下调菜单请到这里:http://www.csnewbie.com/eas-cs-drounddown-menus/





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签