Last active
August 29, 2015 14:27
-
-
Save volontarian/8942487d172dd69aa999 to your computer and use it in GitHub Desktop.
Twitter Bootstrap 3 alerts per JavaScript
This file contains 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
window.bootstrapAlert = (type, message) -> | |
$('#alert_message').text message | |
$('#alert').addClass "alert-#{type}" | |
$("#alert").slideDown() | |
setTimeout (-> | |
$("#alert").slideUp(400, -> | |
$('#alert').removeClass "alert-#{type}" | |
) | |
), 5000 |
This file contains 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
<div class='container-fluid'> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div id="alert" class="alert alert-dismissible" role="alert" style="display:none;"> | |
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> | |
<span id="alert_message"></span> | |
</div> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment