Skip to content

Instantly share code, notes, and snippets.

Created June 26, 2022 15:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Toastr Example
<p>Click <a href="" target="_blank">here</a> for more examples.</p>
<p>You'll notice that the JS is more or less empty and is just what I need to make the example work.</p>
<p>I linked my CodePen to use the following two files:</p>
<li><a href="" target="_blank">toastr.min.css</a></li>
<li><a href="" target="_blank">toastr.min.js</a></li>
// Set the options that I want
toastr.options = {
"closeButton": true,
"newestOnTop": false,
"progressBar": true,
"positionClass": "toast-bottom-center",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
$(document).ready(function onDocumentReady() {
setInterval(function doThisEveryTwoSeconds() {
toastr.success("Hello World!");
}, 2000); // 2000 is 2 seconds
<script src=""></script>
<script src=""></script>
<link href="" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment