I want create a div container with a message for first time visitors to my site. Visitors will read it and click a 'Hide' button to dissapear it forever.
How is this done?
I want create a div container with a message for first time visitors to my site. Visitors will read it and click a 'Hide' button to dissapear it forever.
How is this done?
What about using the Cookie plugin for jQuery?
$.cookie('the_cookie', 'the_value'); // Create a session cookie ("the_cookie") and set its value to "the_value"
$.cookie('chocolate_chip_cookie', 'the_value', { // create a cookie with all available options
expires: 7, // expires in seven days
path: '/', // accessible from the whole site...
domain: 'jquery.com',
secure: true // ...but only on a secure connection
});
$.cookie('the_cookie', null); // delete the session cookie
You can accomplish this by:
You can do 1. with JavaScript but also with PHP. 2. can only be accomplished server-side with e.g. PHP.
This tutorial may be helpful: http://www.shopdev.co.uk/blog/cookies-with-jquery-designing-collapsible-layouts/