Last active
December 12, 2015 06:08
-
-
Save benubois/4726679 to your computer and use it in GitHub Desktop.
Select nested jquery tabs within tabs. Using a query string like ?selected_tabs=tab-3,section-tab-2. The selected tabs should be the comma separated ids of the tabs that should be active.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tabSelect: function(args) { | |
var queryString = greenplum.queryString(); | |
if (typeof(queryString.selected_tabs) == 'string') { | |
var selectedTabs = queryString.selected_tabs.split(','); | |
var parentTabs = ''; | |
for (var i=0; i < selectedTabs.length; i++) { | |
var index = jQuery('[href~=#' + selectedTabs[i] + ']', parentTabs).parent('li').index(); | |
var tabs = jQuery(jQuery('#' + selectedTabs[i], parentTabs).parents('.tabs')[0]); | |
tabs.tabs().tabs('select', index); | |
var parentTabs = jQuery('#' + selectedTabs[i], parentTabs); | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment