lundi 11 mars 2019

jQuery Plugin: Easy-Responsive-Tabs-to-Accordion. How do I load information for a tab after a callback?

I'm using Laravel 5.4 and this jQuery plugin.
When a tab is clicked i'm calling one of my controllers and returning data.
My question is how do I display that data on the tab that was clicked?
I'm seeing my controller return the response to my callback function just don't know how to display it on the tab.

    $('.tabs').easyResponsiveTabs({
    type        : 'default', //Types:  default, vertical, accordion
    width       : 'auto', //auto or any width like 600px
    fit         : true, // 100% fit in a container
    tabidentify : 'hor_1', // The tab groups identifier
    activate    : function(event) { // Callback function if tab is switched

        $.ajax({url: "", success: function(result){
            console.log(result);//this prints my data correctly
            //how do i display result in the tab that was clicked?
        }});

    }
});

My Html is

<div  class="tabs">
    <ul class="resp-tabs-list hor_1">
        <li>Test 1</li>
        <li>Test 2</li>
        <li>Test 3</li>
        <li>Test 4</li>
        <li>Test 5</li>

    </ul>
    <div class="resp-tabs-container hor_1">
        <div> Test 1</div>
        <div> Test 2</div>
        <div> Test 3</div>
        <div> Test 4</div>
        <div> Test 5</div>
    </div>
</div>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire