How to go to a specific tab with jquery?

0

Good afternoon I have the following tabs made this way:

<div id="tab-1" class="tab active"></div>
<div id="tabTitular" class="tab"></div>
<div id="tabAfiliado" class="tab"></div>
<div id="formaentregaPedido" class="tab"></div>
<div id="historialCarrito" class="tab">
    <button id="enviarPedido" class="">Confirmar</button>
</div>

All this within a view carrito.html , when I am in the tab with id="historialCarrito" in this section there is a button Confirm, that button sends me to another view.

The detail I have is when I am in another view otravista.html I tried to return to the carrito.html since obviously starts again from id="tab-1" , then what I need to do is that when I am in otravista.html and return to the view carrito.html enter directly to tab id="historialCarrito" . I have the following function, but I do not know how to do such a thing.

$("#regresarCarrito").on('click', function(e){
    mainView.router.load({
        url: 'vistas/carrito.html',
    });

    myApp.showTab("#historialCarrito", true);
});
    
asked by JG_GJ 12.10.2018 в 00:16
source

0 answers