Show welcome div only once per user / browser session

Set a cookie.

$(document).ready(function() {
    if ($.cookie('noShowWelcome')) $('.welcome').hide();
    else {
        $("#close-welcome").click(function() {
            $(".welcome").fadeOut(1000);
            $.cookie('noShowWelcome', true);    
        });
    }
});

You need to include jQuery.cookie javascript file.

https://raw.githubusercontent.com/carhartl/jquery-cookie/master/src/jquery.cookie.js

Leave a Comment