Created
January 7, 2017 15:48
-
-
Save wellingtonpgp/ee1f7f2c74c03b968334df268a09baf7 to your computer and use it in GitHub Desktop.
Função para retornar mensagem com jquery e bootsrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function msg(msg, tipo) { | |
| var retorno = $('.retorno'); | |
| var tipo = (tipo === 'sucesso') ? 'success' : (tipo === 'alerta') ? 'warning' : (tipo === 'erro') ? 'danger' : (tipo === 'info') ? 'info' : alert('Informe a mensagem'); | |
| retorno.empty().fadeOut('fast', function () { | |
| return $(this).html('<div class="alert alert-'+tipo+'">'+msg+'</div>').fadeIn('slow'); | |
| }); | |
| setTimeout(function () { | |
| retorno.fadeOut('slow').empty(); | |
| }, 9000); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment