Bootstrap Skeleton
This is a simple Bootstrap skeleton. You can fork it to get a ready to use Bootstrap fiddle.
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.1.0/bootstrap.min.js"></script>
<div id="alert_placeholder"></div>
<button onclick="bootstrap_alert['warning']('Warning!')">Show Warning</button>
<button onclick="bootstrap_alert['info']('Info!')">Show Info</button>
CSS
@import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');
JavaScript
bootstrap_alert = function() {
}
bootstrap_alert.warning = function(message) {
$('#alert_placeholder').append('<div class="alert alert-block fade in"><button type="button" class="close" data-dismiss="alert">×</button><h4>Info!</h4>'+ message +'</div>');
alertTimeout(3000); //Called here
}
bootstrap_alert.info = function(message) {
$('#alert_placeholder').append('<div class="alert alert-block alert-info fade in"><button type="button" class="close" data-dismiss="alert">×</button><h4>Info!</h4>'+ message +'</div>');
alertTimeout(3000); //and here
}
function alertTimeout(wait){
setTimeout(function(){
$('#alert_placeholder').children('.alert:first-child').remove()
}, wait);
}