Created
September 27, 2012 19:01
-
-
Save walterdavis/3795775 to your computer and use it in GitHub Desktop.
Hide a message for an entire session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var message_box = 'item42'; | |
var jar = new CookieJar({expires: ''}); | |
//you can also set expires to any number of seconds | |
if(!!jar.get('hide_message')){ | |
$(message_box).hide(); | |
}else{ | |
jar.put('hide_message',true); | |
$(message_box).observe( | |
'click', | |
function(evt){ | |
this.hide(); | |
} | |
).setStyle('cursor:pointer'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment