这曾经与我的旧导航一起使用,但现在不使用引导程序。我已经看到 .nav a 的 javascript 解决方案,但我不能有链接,因为我使用 javascript 将页面加载到主容器中。我这里有什么选择吗?谢谢
<ul class="nav">
<li class="active" id="changetohome"><a style="cursor:pointer" id="changetohome"><i class="icon-home"></i> Home</a></li>
<li class="none" id="changetodiscover"><a style="cursor:pointer" id="changetodiscover"><i class="icon-home"></i> Explore</a></li>
</ul>
$('#changetohome').click(function () {
$('#loadingAjaxs').show(); $('#flubestext').hide();
$('#contentwrap').load('@Url.Action("FollowingDetail", "Following", new {@ajax = "yes"})', function () {
$('#loadingAjaxs').hide(); $('#flubestext').show(); window.history.pushState({ "page": "home" }, 'title1', '/'); $(window).scrollTop(0);
document.getElementById("changetohome").className = "active";
document.getElementById("changetodiscover").className = "none";
})
});
$('#changetodiscover').click(function () {
$('#loadingAjaxs').show(); $('#flubestext').hide();
$('#contentwrap').load('@Url.Action("TagPageDetail", "TagPage", new {@page = 0, @ajax = "yes"})', function () {
$('#loadingAjaxs').hide(); $('#flubestext').show(); window.history.pushState({ "page": "discover" }, 'title', '/discover'); $(window).scrollTop(0);
document.getElementById("changetohome").className = "none";
document.getElementById("changetodiscover").className = "active";
})
});