Monday, 22 October 2018

Auto Close Bootstrap Alerts

Hi guys.. follow the step below for make auto close bootstrap alerts.

1. HTML
<div class="alert alert-success" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Success!</strong> You have been signed in successfully!
</div>

2. CSS
@import "compass/css3";

body{
  padding: 50px;
}

3. JS
window.setTimeout(function() {
    $(".alert").fadeTo(500, 0).slideUp(500, function(){
        $(this).remove(); 
    });
}, 4000);

Please click link for TUTORIAL.

Sekian Terima Kasih.
-------------------------------------------------------------------
Disediakan Oleh : Zainimar Binti Zulkifli
Sumber :https://codepen.io/CSWApps/pen/XJoLmN

0 comments:

Post a Comment