Bootstrap Tutorial - Create Faded Alert








The following code shows how to create Faded Alert.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.8.3.js'></script>
<style type='text/css'>
@import url('http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css');
</style><!--   www.j  av  a  2  s  .  c om-->
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
function showAlert() {
    $("#myAlert").addClass("in");
}
window.setTimeout(function () {
    showAlert();
}, 3000);
});//]]>  
</script>
</head>
<body style='margin:30px'>
  <div id="myAlert" class="alert success fade" data-alert="alert">This
    is the alert.</div>
</body>
</html>

Click to view the demo