First, I only have to download the content once for each agreement, and then use the Ajax callback to apply the tab settings, etc.
Also, for your tab naming convention (I see that you are using <div id="1"> ), I would recommend not using numbers for IDs, as I have seen that this causes problems with JS / JQ, therefore, maybe go to #tabs -one, # tabs-two, etc.
Here is an example:
$(document).ready(function() { $('.accordion-toggle').on('click', function () { var parentRef = $(this).attr('href'), $innerContent = $(parentRef).find('.accordion-inner'); //only load group once if($innerContent.text() ===''){ $innerContent.load('http://fiddle.jshell.net/NPpHm/show/', function(){ var $this = $(this), $innerTabs = $this.find('.nav-tabs'); console.log($innerTabs); var tabOpts = { active: 0, cookie: {expires: 3}, show: onTabShow, fillSpace: false, autoHeight: true, collapsible: false }; $innerTabs.tabs(tabOpts).fadeIn(700); }); } }); });
source share