Skip to content

Instantly share code, notes, and snippets.

@gtallen1187
Created March 13, 2014 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtallen1187/7e0f4b25e0904b12524e to your computer and use it in GitHub Desktop.
Save gtallen1187/7e0f4b25e0904b12524e to your computer and use it in GitHub Desktop.
function dyn_notice() {
var percent = 0;
var notice = $.pnotify({
title: "Please Wait",
type: 'info',
icon: 'picon picon-throbber',
hide: false,
closer: false,
sticker: false,
opacity: .75,
shadow: false,
width: "170px"
});
setTimeout(function() {
notice.pnotify({
title: false
});
var interval = setInterval(function() {
percent += 2;
var options = {
text: percent + "% complete."
};
if (percent == 80) options.title = "Almost There";
if (percent >= 100) {
window.clearInterval(interval);
options.title = "Done!";
options.type = "success";
options.hide = true;
options.closer = true;
options.sticker = true;
options.icon = 'picon picon-task-complete';
options.opacity = 1;
options.shadow = true;
options.width = $.pnotify.defaults.width;
//options.min_height = "300px";
}
notice.pnotify(options);
}, 120);
}, 2000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment