"Call modal alert"
Bootstrap 3.2.0 Snippet by hiroyujin

<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <html> <head> </head> <body> </body> </html>
.modal-primary .modal-dialog .modal-content{ background-color:#1E9295; color:#fff; border: 0px; } .modal-danger .modal-dialog .modal-content{ background-color:#F73030; color:#fff; border: 0px; } .modal-inverse .modal-dialog .modal-content{ background-color:#303030; color:#fff; border: 0px; } .modal-info .modal-dialog .modal-content{ background-color:#13CFFB; color:#fff; border: 0px; } .modal-warning .modal-dialog .modal-content{ background-color:#F79130; color:#fff; border: 0px; } .modal-success .modal-dialog .modal-content{ background-color:#23B555; color:#fff; border: 0px; }
$(document).ready(function(){ loadAlert({mensagem:'Bom retorno',titulo:'Como dizia a minha vó',style:'primary',align:'center',size:'md',callback:'alert("FINISH")'})}) function bootsAlert(options) { if(typeof options === "undefined"){var options = ""}; var style = (typeof options.style === "undefined") ? "default" : options.style; var message = (typeof options.message === "undefined") ? "" : options.message; var title = (typeof options.title === "undefined") ? "" : options.title; var time = (typeof options.time === "undefined") ? 0 : options.time; var size = (typeof options.size === "undefined") ? 'md' : options.size; var align = (typeof options.align === "undefined") ? 'left' : options.align; var callback = (typeof options.callback === "undefined") ? '' : options.callback; var before = (typeof options.before === "undefined") ? '' : options.before; var html = '<div class="modal modal-'+style+' fade" id="loadAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">'; html += ' <div class="modal-dialog modal-'+size+'">'; html += ' <div class="modal-content">'; html += ' <div class="modal-header">'; html += ' <button type="button" class="close closeAlertModal" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Fechar</span></button>'; html += ' <h4 class="modal-title">'+title+'</h4>'; html += ' </div>'; html += ' <div class="modal-body text-'+align+'">'; html += ' <p>'+message+'</p>'; html += ' </div>'; html += ' </div>'; html += ' </div>'; html += ' </div>'; eval(before); if ( $("#boxAlert").length ){}else{$('body').append('<div id="boxAlert"></div>');} $("#boxAlert").html(html); $('#loadAlert').modal('show'); if(time!=0) {setTimeout(function(){$('#loadAlert').modal('hide')},time)}; $('#loadAlert').on('hidden.bs.modal', function () {eval(callback)}); }

Related: See More


Questions / Comments: