1 Replies - 757 Views - Last Post: 29 November 2012 - 10:03 PM

Questions about making lightbox for ads/opt-ins

Posted 29 November 2012 - 02:22 PM

I would like to create a "plugin" (not sure what else to call it right now) that allows me to display a lightbox with content and display that at various intervals using data stored in a cookie. I'm talking about something like Aweber uses to display opt-in forms for email newsletters. This is ultimately what I'd like to use it for. I know that there are lightbox tutorials all over Youtube and I can use that for help there. But I don't want to display a lightbox EVERY time the page loads. For example, I only want to display it maybe once every couple of days or so. I'm assuming, making a cookie is the best way to do this. I'm just not sure exactly where to start, what languages to use, and so on.

Here's what I do know
I can create a lightbox using JQuery and CSS.
I can make cookies either in PHP or Javascript, but not sure which ones.
Cookies live on user's computer and can store info, but not sure how to make those variables/info interact with web page. I know this all depends on the language used and what kind of site you're talking about, and if a CMS is used, etc.

I'm not looking for help with specific code yet, but just wondering if someone could provide an overall plan of attack for this project. Perhaps some bullet points of steps to take. Thanks everyone, I appreciate it.

So now, should I turn that entire block of javascript into a single function and call it based on data from the cookie? For instance, I'd like to place a cookie on the client machine, and if the cookie has "expired" (not sure if that's the right word), call the function to launch the lightbox.

For example, let's say a visitor visits on Monday and they see my light box ad. I don't want them to see it again until Wednesday. Can someone give me guidance here.