Hello, I put up a banner, where I need it when the user enters the site and clicks the GOT IT button it disappears and when the user re-enters the site or uploads another link does not appear anymore. Disappear I got it, but save the user with cookie no, I found an example (below) but I did not understand the implementation !!!
NOTE: Remembering never expires
COOKIE
// Create a cookie
$.cookie('the_cookie', 'the_value');
// Create expiring cookie, 7 days from then:
$.cookie('the_cookie', 'the_value', { expires: 7 });
// Read a cookie
$.cookie('the_cookie'); // => 'the_value'
$.cookie('not_existing'); // => null
// EDIT
// Attaching to a button click (jQuery 1.7+) and set cookie
$("#idOfYourButton").on("click", function () {
$.cookie('the_cookie', 'the_value', { expires: 7 });
});
// Attaching to a button click (jQuery < 1.7) and set cookie
$("#idOfYourButton").click(function () {
$.cookie('the_cookie', 'the_value', { expires: 7 });
});
HTML
<div class="gotit">
<div>
<p>We use cookies in order to improve your browsing experience on sugarcane.org, not to collect personal information. By continuing to use the site, you agree that it is OK. <a href="https://sugarcane.org/privacy-policy">Read about our privacy policy.</a></p>
<a href="#" title="GOT IT">GOT IT</a>
</div>
</div>
JAVASCRIPT
<script>
$(document).ready(function(){
$(".gotit A").click(function(){
$(".gotit").fadeToggle("slow");
});
});
</script>