MyBB Community Forums

Full Version: Close div and show once in 24h
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Try this then:
<script type="text/javascript">
document.observe('dom:loaded', function(){

   var notebox = $$('.notebox')[0];
   if(Cookie.get("sitenote") != "X")
   {
       notebox.style.display = 'block';
   }

   var dismiss = document.getElementById('dismissnote');

   dismiss.addEventListener('click', function() {
       Cookie.set("sitenote", "X", 86400);
       notebox.style.display = 'none';
   }, false);

});
</script>
Add it at the end of headerinclude.

Works for me.. http://testingforum.bl.ee/forum/
D666 baby you've just nailed it you are awesome thanks very much!
D666 please I am want to show this code only to logged in user but it ain't showing when logged in???
It has nothing to do with login/logout state, so you're doing something wrong. You need to put it to a template that's visible for everyone and obviously not close it for 24 hours so it reappears (or delete cookie)..

Register and login on the linked test site above (without closing it) and you'll see it works...
OMG I am so sorry the code was inside a guest conditional LOL thanks D666 you're the man!
Pages: 1 2