0
You can, for example, access http://exemplo.com#listaReservas:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<ul class="nav nav-tabs" id="myTab">
<li class="active"><a data-target="#home" data-toggle="tab">home</a></li>
<li><a data-target="#listaReservas" data-toggle="tab">Lista de Reservas</a></li>
<li><a data-target="#lista-espera" data-toggle="tab">Lista de espera</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="home">Home</div>
<div class="tab-pane" id="listaReservas">Lista de Reservas</div>
<div class="tab-pane" id="lista-espera">Lista de espera</div>
</div>
<script>
var tab_on = location.hash; // aqui é onde vamos agarrar o valor da hash do url (ex: #listaReservas)
$('#myTab a[data-target="' +tab_on+ '"]').tab('show');
$('#myTab a').on('click', function() {
var this_target = $(this).data('target');
var window_href = window.location.href.split('#')[0];
history.pushState('', '', window_href+this_target); // mudar o url dinamicamente
});
</script>
And what is your question?
– Leo
I’m sorry, how can I?
– Alisson Hoepers
Alisson, go to Help and take the Sopt Tour if you haven’t already done it. You can edit your question making it clear and objective. What do you want to know? What’s your problem? That’s it, we need information to help you.
– Leo
Another thing, I checked that you have not marked the answers to your questions, you should mark the one that best answered you or indicated a solution, and you can also vote on questions and resonators that are important or interesting to you. So you participate better and contribute to the community.
– Leo
Hello Alisson. I noticed that you have flagged your own questions with explanations that I am not understanding. In this case was:
Nav-tabs bootstrap
. What do you mean? The signage of a post serves to prompt the attention of a moderator to solve any problem with the post, and you are using the signage incorrectly. See your signage history here: http://answall.com/users/flag-summary/45854 To notify me use a @ before my name.– Math