I am trying to have it look to see if the cookie exists and if not fade in. Then if the user clicks the close button it fades out. What am I doing wrong?
Jquery
$(function() { if ($.cookie("demoCookie") == null) { $("#headerFactInfo").fadeIn(); }; $("#headerFactInfoClose").click(function() { $("#headerFactInfo").fadeOut(); $.cookie( 'demoCookie', '1', { expires: 7, path: '/' } ); }); }); Html
<div id="headerFactInfo">The Great Add <a href="" id="headerFactInfoClose" >Close</a></div>