Question

How can I load ajax content clicking in a link in an accordion and add that content to jquery ui tabs?

I want something like this PARAM QUERY

I'm just starting with javascript and jquery so I don't know how to achieve this

Thanks

Was it helpful?

Solution

You can add a new tab to the jQuery UI tabs header and then trigger the refresh function and select that new tab. Here is a code snippet that should help:

var $mytabs = $('#mytabs'), 
    $accordion = $('#accordion'), 
    addTab = function() {
        var time = new Date().getTime();
        $mytabs.find('ui-tabs-nav').filter(':first').append('<li><a href="data.php?t=' + time + '">New Tab!</a></li>').tabs('refresh');
        $mytabs.tabs('refresh').tabs('select', 'data.php?t=' + time
    };
$accordion.accordion({
    activate: addTab
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top