javascript - Collapsed Bootstrap navbar button won't work on pages that aren't located in the root folder -
i'm having issue opening collapsed menus pages aren't located in root folder. navbar part of masterpage , works fine on pages located in root folder when page located in subfolder button open collapsed menu won't respond (for instance: ./default menu appears , when collapsed button drops down menu intended, ./admin/default menu visible onced collapsed button unresponsive). being it's part of code masterpage, don't understand why occuring on pages.
<%@ master language="vb" codefile="masterpage.master.vb" inherits`="masterpage" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <asp:contentplaceholder id="head" runat="server"></asp:contentplaceholder> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="css/stylesheet.css" rel="stylesheet" type="text/css" /> </head> <body> <form runat="server"> <asp:sitemapdatasource id="sitemapdatasource1" runat="server" showstartingnode="false" /> <div class="navbar navbar-inverse navbar-static-top"> <div class="container"> <div class="navbar-header"> <!-- .btn-navbar used toggle collapsed navbar content --> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="/default.aspx" class="navbar-brand">slpl automated circulation system</a> </div> <!-- want hidden @ 940px or less, place within here --> <div id="navbar" class="navbar-collapse collapse"> <div class="navbar-header"> <asp:menu id="menu_master" runat="server" enableviewstate="false" includestyleblock="false" orientation="vertical" staticmenustyle-cssclass="nav navbar-nav" staticselectedstyle-cssclass="active" dynamicmenustyle-cssclass="dropdown dropdown-menu" datasourceid="sitemapdatasource1"></asp:menu> </div> <ul class="nav navbar-nav navbar-right"> <li> <asp:loginstatus id="loginstatus1" runat="server" logoutpageurl="~/default.aspx" /> </li> </ul> </div> </div> </div> <div class="container"> <asp:contentplaceholder id="contentplaceholder1" runat="server"></asp:contentplaceholder> </div> <footer> </footer> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { //to fix collapse mode width issue $(".nav li,.nav li a,.nav li ul").removeattr('style'); //for dropdown menu $(".dropdown-menu").parent().removeclass().addclass('dropdown'); $(".dropdown>a").removeclass().addclass('dropdown-toggle').append('<b class="caret"></b>').attr('data-toggle', 'dropdown'); //remove default click redirect effect $('.dropdown-toggle').attr('onclick', '').off('click'); }); </script> <script src="js/bootstrap.min.js"></script> <asp:contentplaceholder id="contentplaceholder2" runat="server"></asp:contentplaceholder> </form>
Comments
Post a Comment