Skip to content

Instantly share code, notes, and snippets.

@chadhutchins
Created May 13, 2010 01:16
Show Gist options
  • Save chadhutchins/399366 to your computer and use it in GitHub Desktop.
Save chadhutchins/399366 to your computer and use it in GitHub Desktop.
// assuming jquery and the cookie plugin are already included.
$("html").addClass("js");
$(document).ready(function() {
if ($.cookie('exp_alert_banner_newsletter')!='hide') {
$("p.alert").slideDown("slow");
$("p.alert span.hidealert a").click(function() {
$("p.alert").slideUp("slow");
var date = new Date();
date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));
$.cookie('exp_alert_banner_newsletter', 'hide', { path: '/', expires: date });
return false;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment