When close bootstrap modal with 2 tabs the focus not return to the first tab always stays in the second tab
The problem is what
HTML, BLADE:
<a class="Ver" href="javascript:void(0)" title="Ver" data-toggle="modal" data-target="#DvModalOperacionesMensajes">
<div class="modal fade" name="DvModalOperacionesMensajes" id="DvModalOperacionesMensajes" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-center" name="H4ModalOperacionesMensajes"></h4>
</div>
<div class="modal-body">
<ul class="nav nav-tabs">
<li class="active"><a href="#Ver" data-toggle="tab">Ver Mensaje</a></li>
<li><a href="#Responder" name="AResponder" data-toggle="tab">Responder Mensaje</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="Ver">
Content 1
</div>
<div class="tab-pane fade" id="Responder">
Content 2
</div>
</div>
</div>
<div class="modal-footer">
{!! Form::button("<i class='fa fa-remove fa-lg'></i> Cerrar", array("class" => "btn btn-default", "data-dismiss" => "modal")) !!}
</div>
</div>
</div>
</div>
try this
$('div[name=DvModalOperacionesMensajes]').on("hidden.bs.modal", function () {
InicializarCampos ();
$('#DvModalOperacionesMensajes a:first').tab('show');
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.