最后一個js代碼
<script>
? ?$(document).ready(function(){
? ? ? ?$("#demo-navbar .dropdown-menu a").click(function(){
? ? ? ? ? ?var href = $(this).attr("href");
? ? ? ? ? ?$("#tab-list a[href='" + href + "']").tab("show");
? ? ? ?});
? ?});
</script>求指點,為什么我的沒反應啊,標簽頁根本不切換,每點一次自動就回到頂部
2016-11-27
??????????????<script?src="js/jquery-3.1.1.min.js"></script> ??????????????<script?src="js/bootstrap.min.js"></script> ??????????????<script?type="text/javascript"> ??????????????$(document).ready(function?()?{ ??????????????$("#demo-navbar?.dropdown-menu?a").click(function?()?{ ??????????????var?href=$(this).attr("href"); ??????????????$("#tab-list?a[href='"+href+"']").tab("show"); ??????????????}) ??????????????}) ??????????????</script>? ? ? ? ? ? ? ? ? ? ? ? ?注意順序,要先引入jq,再引入bootstrap,最后引入自定義jq內容
2016-10-17
可能是你的標簽頁的a 的href屬性沒設置具體id