Hello, Thanks for reading this and i hope you can help me today Right, I have a forum [Dhgaming.com] And have many affiliate sites which require the user to vote for the particular affiliate to put the sites rank up. This will ofcorse help people looking for our web site on the affiliates site. But to the point. I would like it so that when the index page is loaded the screen is grayed out something like this http://codingatlas.wordpress.com/2006/07/08/darken-the-page-and-set-focus-on-the-user-input/ But i don't want to anoy the hell out of my users, and would like to make the script so that it only appears once every 25 hours. I'm assuming this would be needed to be done with Cookies but i don't have a clue how. If someone is willing to help me, or even make a script for me. It would be really apricated. Thanks : )
this is called / referred to as a MODAL view dialog/focus. check either thickbox (jquery - google for it, its popular enough) or smoothbox (inline content demo - mootools - http://gueschla.com/labs/smoothbox/). of course, there are lots more you can find - but ultimately, you will need to set a cookie via the framework also, and check for it. not difficult at all, hopefully somebody will help you.
jQuery does not have built in cookie functions - but the ones on QuirksMode blog are quite reliable. Essentially do the following (this is your function to display the Modal Thick Box... i'm just showing what you would add). The cookie actually does not need to store anything but dummy text. You can take advantage of the fact that if the cookie is expired - the browser will delete it - you wont be able to read it - and you then know it is time to display your Modal again. Of course user clearing cookies defeats this - but that is best you can do... function displayModal() { var last = readCookie("lastDisplay"); if(last == null) { // Cookie expired or never set // do your stuff to display your modal here // once modal is displayed - write a cookie - with an expiry as long as you want writeCookie ("lastDisplay","dummyText",15); } else { // do nothing - cookie is still valid } } Note - you will need to make sure your SetCookie function can set to specificity of hours - for its expiry time - if you want it to be say for 15 hours... Just Google "SetCookie Javascript" or "WriteCookie Javascript" and you will get about a zillion different scripts that will work for the setting and reading of the cookie...