toast js

215

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
new Toast({
  message: 'This is an example with custom buttons',
  type: 'success',
  customButtons: [
    {
      text: 'Refresh the page',
      onClick: function() {
        window.location.reload();
      }
    },
    {
      text: 'Follow @ireaderinokun',
      onClick: function() {
        window.open('https://twitter.com/ireaderinokun');
      }
    }
  ]
});
var toastTrigger = document.getElementById('liveToastBtn')
var toastLiveExample = document.getElementById('liveToast')
if (toastTrigger) {
  toastTrigger.addEventListener('click', function () {
    var toast = new bootstrap.Toast(toastLiveExample)

    toast.show()
  })
}

Comments

Submit
0 Comments