August 20, 201214 yr So I'm making our sites compliant just using the notion that if the user is on the site they accept our usage of cookies. I'm using the cookie plugin to have a very simple bar at the top. This is my code: $(document).ready(function(){ //get the value var modalcookie = $.cookie('modalcookie'); if(modalcookie == "yes") { $("p.cookie").hide(); } $("p.cookie").click(function(e){ $(this).fadeOut("fast"); $.cookie('modalcookie', "yes"); }); }); It seems OK for me in Chrome but some weird behaviour elsewhere. My girlfriend says for her, when the page loads the message shows but disappears on its own. It should only disappear when the user has clicked it as that's the only way to set the cookie value. And myself, in Firefox, even after you have clicked the message it shows on some pages but not on others. Any ideas? I couldn't find any code examples so I wrote this code myself.
August 24, 201214 yr Author Nevermind! I fixed it. I needed to add in a setting for the script to make sure the cookie applied to the root path and not specifically only to the page.
August 29, 201214 yr I would be interested in the codes if you still have them This cookie thing is driving me mad! How do you know what cookies you are using on your site? I am trying to have a popup box on first visit to the site Any help is much appreciated as i am not sure where to start Thanks Katrina
Create an account or sign in to comment