jquery - Bootstrap: url or link to open tab and expand accordion -


i've been able locate js either expand specific accordion...

$(document).ready(function () { location.hash && $(location.hash + '.collapse').collapse('show'); }); 

or open specific tab...

var gotohashtab = function (customhash) {  var hash = customhash || location.hash;  var hashpieces = hash.split('?'),   activetab = $('[href=' + hashpieces[0] + ']');   activetab && activetab.tab('show'); }  // onready go tab requested in page hash gotohashtab();  // when nav item selected update page hash $('.nav a').on('shown', function (e) {     window.location.hash = e.target.hash; })  // when link within tab clicked, go tab requested $('.tab-pane a').click(function (event) {     if (event.target.hash) {         gotohashtab(event.target.hash);     } }); 

used along link or url looks this...

http://mysite.com/page#tab_or_accordion_id 

what i'd able open specific tab id expand specific accordion id. use make in-article jumps specific, categorized (with tabs) faq. can't seem figure out how stitch these working. consider me new working jquery , bootstrap -- appreciated.


Comments