Project Description:
Greetings,
Our website currently has a lightbox that shows up every time the user enters the website (and views any webpage). We would like to change the behavior of the lightbox so that once the user signs up (fills out a contact form with their email address) the lightbox does not show again.
In order to do this we envision setting a cookie on the user's machine once he reaches the success page for the signup. The cookie should have an expiration of 365 days. If the cookie is set the user will not see the shadowbox again.
We currently use a Joomla plugin in order to show the lightbox, so you would have to make changes to the existing plugin.
This is the shadowbox joomla plugin we are using:
http://extensions.joomla.org/extensions/multimedia/multimedia-display/9220
Additional Project Description:
05/15/2012 at 20:31 EDT
In order to simplify development i suggest the following:
This is the javascript call in order to open the lightbox in joomla:
<script type="text/javascript">
window.onload = function(){
Shadowbox.init();
Shadowbox.open({
player: 'iframe',
width:775,
height:453,
content: 'http://www.xyz.com.br/shadow.htm',
});
};
</script>
I suggest creating a javascript function that checks if the cookie has been set to "signup-ok". If the cookie has been set then the shadowbox.init() function is called (followed by .open())
so something like this:
<script type="text/javascript">
window.onload = function(){
var verifyCookie;
verifyCookie = Shadowbox.verify();
if(verifyCookie = false) {
Shadowbox.init();
Shadowbox.open({
player: 'iframe',
width:775,
height:453,
content: 'http://www.xyz.com.br/shadow.htm',
});
}
};
</script>
The cookie will need to be set on the success page.
cheers