如何使用响应式bootstrap css设置asp.net菜单控件的样式

时间:2015-06-11 02:29:00

标签: css asp.net twitter-bootstrap-3 webforms

http://techbrij.com/responsive-menu-twitter-bootstrap-asp-net

我按照这个链接使菜单控制响应但没有运气。有人告诉我这个链接有什么问题吗?

我在代码中复制了下面的代码,以了解它在调整浏览器大小时的响应方式。我注意到悬停功能仍处于活动状态,而不是单击ipad模式。

<div class="navbar">
<div class="navbar-inner">
    <div class="container">
     <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>
    <!-- Everything you want hidden at 940px or less, place within here -->
        <div class="nav-collapse collapse">
            <asp:Menu ID="NavigationMenu" runat="server" EnableViewState="false"
                IncludeStyleBlock="false" Orientation="Horizontal"
                CssClass="navbar navbar-fixed-top"
                StaticMenuStyle-CssClass="nav"
                StaticSelectedStyle-CssClass="active"
                DynamicMenuStyle-CssClass="dropdown-menu">
                <Items>
                    <asp:MenuItem Text="Home" ToolTip="Home"></asp:MenuItem>
                    <asp:MenuItem Text="Music" ToolTip="Music">
                        <asp:MenuItem Text="Classical" ToolTip="Classical" />
                        <asp:MenuItem Text="Rock" ToolTip="Rock" />
                        <asp:MenuItem Text="Jazz" ToolTip="Jazz" />
                    </asp:MenuItem>
                    <asp:MenuItem Text="Movies" ToolTip="Movies">
                        <asp:MenuItem Text="Action" ToolTip="Action" />
                        <asp:MenuItem Text="Drama" ToolTip="Drama" />
                        <asp:MenuItem Text="Musical" ToolTip="Musical" />
                    </asp:MenuItem>
                </Items>
            </asp:Menu>
        </div>
    </div>
</div>

1 个答案:

答案 0 :(得分:-1)

hi there as I know this js code will help you

<script type="text/javascript">
    //Disable the default MouseOver functionality of ASP.Net Menu control.
    Sys.WebForms.Menu._elementObjectMapper.getMappedObject = function () {
        return false;
    };
</script>