I have an application ready with layout itself, and inside this layout I use the fancybox. But now I'm forced to migrate to bootstrap
and I'm using AdminLTE-2.1.1 to fit in what I want.
The big question is to migrate the parts with fancybox to the modal. In fancybox it was just declaring a class and giving options of the size of iframe
and opened the page independently, as I show below:
$(".detalhes").fancybox({
closeBtn : true,
type: 'iframe',
'autoSize': false,
'width': 600,
'height': 500
});
Call the link:
<a class="detalhes fancybox.iframe" href="detalhes.php?id='.$row[7].'" >
<img src="imagens/atualiza.png" border=0 title="Ver detalhes "/>
</a>
Already with the modal of bootstrap
, the page opens from the page itself, as follows:
$(document).on('click', '[data-toggle="meumodal"]', function(event){
event.preventDefault();
target = $(this).attr("data-target");
content = $(this).attr("href");
$(target+".modal .modal-content").load(content,function(){
$(target).modal('show');
});
});
modal div:
<div class="modal fade" id="myModal" data-toggle="meumodal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
</div>
</div>
</div>
link call:
<a data-toggle="meumodal" href="detalhes.php?id='.$row[7].'" data-target="#myModal" class="btn btn-info" title="Ver detalhes">
<i class="fa fa-file-zip-o"></i>
</a>
external page div:
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Detalhes Requerimento</h4>
</div>
<div class="modal-body">
CONTEÚDO
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">cancelar</button>
</div>
That is, much more laborious. But regardless, I prefer the migration, even because it would be an unprofessional job.
Is there no other plugin for bootstrap
that calls the standalone page with the modal layout?
No jquery calls work in modal and look exactly like in fancybox.
Example:
$(".curso").hide();
$(".local").hide();
$(".orgao").hide();
$('#tipo').on('change', function () {
var valor = this.value;
if(valor == 3){
$(".curso").show();
$(".local").show();
$(".orgao").hide();
}else if(valor == 2){
$(".curso").hide();
$(".local").show();
$(".orgao").hide();
}else{
$(".curso").hide();
$(".local").hide();
$(".orgao").show();
}
});
$(".data").mask("99/99/9999");