popup.js 593 B

1234567891011121314151617
  1. function popup(kind, body) {
  2. var html = '';
  3. html += '<div id="notification_' + String(window.notification_id) + '" class="notification is-' + kind + '">';
  4. html += '<button class="delete" onclick="$(\'#notification_' + String(window.notification_id) + '\').remove();"></button>';
  5. html += body;
  6. html += '<script>setTimeout(function() {$(\'#notification_' + String(window.notification_id) + '\').fadeOut(500);}, 2500);</script>';
  7. html += '</div>';
  8. $('#notifications').append(html);
  9. window.notification_id++;
  10. }
  11. $(function() {
  12. window.notification_id = 0;
  13. });