I am looking for the following scenario:
- When a new visitor lands on my website, a notice bar fixed to the bottom of the screen becomes visible.
- After clicking on a menu item to navigate to another page, a cookie is set upon the second page load. This cookie will ensure that the notice bar remains hidden for a period of 60 days. It is crucial that the notice bar does not flicker on page load due to the asynchronous loading of Javascript.
- Alternatively, the user can click on the "Ok" button to close the notice bar and set the same cookie.
This is the structure of my HTML:
<div id="cookie-message">
<span>Cookie notice will be displayed here <a href="#">Read more</a> <a href="#" id="cookie-message-close">Ok</a></span>
</div>
I am seeking guidance on how to achieve this functionality using jQuery. Any assistance would be greatly appreciated!