2014-02-03, 02:54 PM
Could anybody help me out here. I want to show a message that will have a close button which will hide the message when clicked, and the message will only show to the user that closed it once in 24 hours?
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='http://demonate.com/jscripts/cdn/jquery-1.8.2.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script type="text/javascript">jQuery.noConflict();</script>
<script type="text/javascript" src="http://demonate.net/CDN/Library/jquery.cookie.js"></script>
(2014-02-03, 06:04 PM)Destroy666 Wrote: [ -> ]You would have to rewrite the code to use MyBB's Cookie.get and Cookie.set instead of jQuery.cookie. Also set div's style.display = "none"; instead of using jQuery's hide() function and use default Javascript onClick method, for instance.
(2014-02-03, 05:48 PM)marcus123 Wrote: [ -> ]Is there a way not to require external files?
<script type="text/javascript">
if(Cookie.get("sitenote") != "X")
{
$$('.notebox')[0].style.display = 'block';
}
var dismiss = document.getElementById('dismissnote');
dismiss.addEventListener('click', function() {
Cookie.set("sitenote", "X", 86400);
$$('.notebox')[0].style.display = 'none';
}, false);
</script>
Add it after Prototype is loaded.