Skip to content

Instantly share code, notes, and snippets.

Last active January 12, 2022 08:43
  • Star 1 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
Save micah1701/c641c40a18e28b7dc064ed3c3a37f6c4 to your computer and use it in GitHub Desktop.
Extends CSS framework with a short-lived notification message that slides up from the bottom of the screen. Useful for showing user that a change has occurred on the page. Requires jQuery.
* display a quick notification box that slides up from the bottom for a few seconds
function quickNotice(message,cssClass,timeOnScreen)
cssClass = (cssClass) ? cssClass : 'is-success';
timeOnScreen = (timeOnScreen) ? timeOnScreen : 3000;
var html = '<div id="quickNotice" style="position: absolute; z-index: 100; width: 100%" class="notification has-text-centered has-text-weight-semibold '+cssClass+'">';
html+= message;
html+= '</div>';
var notice = $("#quickNotice"),
startPosition = (notice.innerHeight()) * -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment