Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

adding cookie to remember hidden div

Hi, I have the following code to fade out a welcome div to a sharepoint list. The problem is however whenever the page is refreshed the hidden div becomes visible again. I've used the jquery cookie plugin to try and get round this but having trouble getting it to work. here is my code so far:

         $(document).ready(function() {

         $('#continue').click(function(e) {

             $('#MSOZoneCell_WebPartWPQ2').fadeIn(2000);
             $('#MSOZoneCell_WebPartWPQ2').css('display', 'table');
             $.cookie('content', 'visible');

             $('#info, #infocont').fadeOut(2000);
             $.cookie('content', 'hidden');

             if ($.cookie('#MSOZoneCell_WebPartWPQ2') == 'visible') {
                 $('content').css('display', 'table');
             };

             if ($.cookie('content') == 'hidden') {
                 $('#info, #infocont').css('display', 'block');
             };
         });

Can you add the HTML and CSS that goes with this code.