我已经找到JS来扩展特定的手风琴...
$(document).ready(function () {
location.hash && $(location.hash + '.collapse').collapse('show');
});
或者打开一个特定的标签......
var gotoHashTab = function (customHash) {
var hash = customHash || location.hash;
var hashPieces = hash.split('?'),
activeTab = $('[href=' + hashPieces[0] + ']');
activeTab && activeTab.tab('show');
}
// onready go to the tab requested in the page hash
gotoHashTab();
// when the nav item is selected update the page hash
$('.nav a').on('shown', function (e) {
window.location.hash = e.target.hash;
})
// when a link within a tab is clicked, go to the tab requested
$('.tab-pane a').click(function (event) {
if (event.target.hash) {
gotoHashTab(event.target.hash);
}
});
与一个看起来像这样的链接或网址一起使用...
http://mysite.com/page#tab_or_accordion_id
我希望能够做的是打开一个特定的标签ID,然后扩展一个特定的手风琴ID . 我想使用它来进行特定的分类(带标签)FAQ的文章内跳转 . 我似乎无法弄清楚如何将它们拼接在一起以使其工作 . 考虑我使用jQuery和Bootstrap的新手 - 任何帮助将不胜感激 .