當我單擊選項卡配置文件,然後更改li類時,我無法將li類(主頁)從「活動」更改爲無(或其他類)配置文件)從配置文件激活時,從無到'有效'。如何將li類從活動更改爲無
這裏是我的代碼:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<asp:PlaceHolder runat="server">
<%-- Style Section --%>
<%: Styles.Render("~/bundles/Css") %>
</asp:PlaceHolder>
<script type="text/javascript">
function openHome() {
location.href = "Home.aspx";
}
function openProfile() {
location.href = "Profile.aspx";
}
</script>
<asp:ContentPlaceHolder ID="StyleSection" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<br />
<div class="container">
<div class="jumbotron">
<h1>
BANNER</h1>
</div>
</div>
<!-- MENU START -->
<ul class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab" onclick="openHome();">Home</a></li>
<li><a href="#profile" data-toggle="tab" onclick="openProfile();">Profile</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home">
</div>
<div class="tab-pane fade" id="profile">
</div>
</div>
<%-- Script Section --%>
<%: Scripts.Render("~/bundles/jQuery") %>
<asp:ContentPlaceHolder ID="ContentSection" runat="server">
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="ScriptSection" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
有人能幫助我嗎?我嘗試了類似的解決方案,我發現在stackoverflow但無法完成工作。非常感謝。
請把你的jQuery代碼放在這裏。 – 2014-10-02 10:40:03
不是[標籤:asp-classic]。 – Lankymart 2014-10-02 11:04:01
其實這個原始頁面是一個.aspx頁面。但是當我發佈時,我刪除了asp內容,因爲我認爲這與我的問題無關。 – user1832038 2014-10-02 11:10:33