Skip to content

Instantly share code, notes, and snippets.

@cers
Created June 14, 2009 21:48
Show Gist options
  • Save cers/129831 to your computer and use it in GitHub Desktop.
Save cers/129831 to your computer and use it in GitHub Desktop.
var klass = "_jetpackNotification";
jetpack.tabs.onReady(function(doc){
$("body",doc).append('<div id="'+klass+'" style="position: fixed; bottom: 0; right: 0; height: 0; width: 151px;"><div style="height: 40px; width: 150px; background: #ddd; border: #999 solid; border-width: 1px 0 0 1px"></div></div>');
});
function notify(options) {
var doc = jetpack.tabs.focused.contentDocument;
$("#"+klass+" div", doc).text(options.body).parent().animate({"height":41},"slow", function(){
setTimeout(function(el){$(el).animate({"height":0},"slow")},3000,this);
});
}
// instead of jetpack.notifications.show(), call notify() with the same argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment