nice-toast-js
Version:
jquery easy & nice Toast
48 lines (37 loc) • 1.28 kB
HTML
<html>
<head>
<title>nice-toast-js Example</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Include Plugin CSS file -->
<link href="./css/nice-toast-js.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<br />
<section class="container">
<div class="row">
<div class="col-md-8">
<button type="button" class="btn btn-primary">Open Toast</button>
</div>
</div>
</section>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript"></script>
<!-- Include Plugin JS file -->
<script src="./js/nice-toast-js.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$.niceToast.setup({
position: "top-center",
timeout: 15000,
});
$('button').click(function (e) {
let toast = $.niceToast.error('<strong>Error</strong>: The password you entered for the username');
toast.change('redirecting ...' ,2000)
});
// Call Plugin
});
</script>
</body>
</html>