Last active
October 31, 2016 10:55
-
-
Save EDDYMENS/5924df10a4b3e7f34d2aefe436dd8ad3 to your computer and use it in GitHub Desktop.
Cool easy way to add pop up flash notification to web frontend with nothing more than bootstrap.
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
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
<div class="modal fade" id="notif" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog" style="width:250px;height:3%;"> | |
<div class="modal-content" style="background-color:#7BE454;"> | |
<div class="modal-body"> | |
<div id="left"> | |
<div> | |
<center> | |
<p><font color="white">Welcome Back</font> | |
</p> | |
</center> | |
</div> | |
</div> | |
<!-- /.modal-content --> | |
</div> | |
<!-- /.modal-dialog --> | |
</div> | |
<!-- /.modal --> | |
<script> | |
$(function() { | |
$('#notif').modal({ | |
keyboard: true | |
}); | |
// remove modal backdrop | |
$('.modal-backdrop').removeClass("modal-backdrop"); | |
}); | |
function hide() { | |
$('#notif').modal('hide'); | |
} | |
// hide backdrop after 2 sec | |
setTimeout('hide()', 2000); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment