Sorry Bev I'm still not there.
My js file now reads like this;
Code:
document.documentElement.className = 'js'; // adds .js class to <html> tag
var cookie = getCookie('consent'),
bar = document.getElementById('consent'),
btn = document.getElementById('ok');
btn.onclick = function() { // hide bar and set cookie when button is clicked
bar.style.display = 'none';
var d = new Date;
d.setTime(d.getTime()+24*60*60*1000*90); // 90 days
document.cookie = "consent=ok;path=/;expires="+d.toGMTString();
}
function getCookie(name) {
var v = new RegExp(name+"=([^;]+)").exec(document.cookie);
return (v != null) ? unescape(v[1]) : null;
}
bar.style.display = (cookie == 'ok') ? 'none' : 'table'; // hide bar if cookie is set
But it still doesn't work.
http://www.castlefordheritagetrust.org.uk/zSandPit.php
John
Bookmarks