Rich-text Reply

Variation of Popup and No-Popup

mvinter 04-21-15
Accepted Solution

Variation of Popup and No-Popup

Hi!

 

I'm trying to make a popup using inspiered by this article on your blog:

http://blog.optimizely.com/2013/09/12/how-to-add-a-lightbox-to-an-experiment/

 

In the very last section there are links to copy-paste friendly versions of the code needed to set up the popup in our own experiment. Very nice of you.

 

Unfortunately, the link to the Java-script code that is needed for the popup to work right appears to be broken. Is there any chance you could please fix the link and republish or simply send me the Javascript code needed to make it run?

 

Thank you!

 

Kind regards

Martin Vinter

Level 1

Mario 04-21-15
 

Re: Variation of Popup and No-Popup

Hi Martin,

 

I agree that the article might be a bit confusing when it comes to the appendix. All you need to reconstruct and run the popup is provided in the two links 'Variation Code ' and 'Global CSS'.

 

Please copy & paste the variation code into your edit code box. The variation code consists of all the HTML markup and the JavaScript code you need.

 

$("div.closer").bind("click", function(){document.getElementById("overlay").style.display="none"; document.getElementById("lightbox").style.display="none"});

 

After that copy the CSS into the 'Experiment CSS', the popup will now appear and you can customize it.

 

Happy testing!

Mario

Technical Support Engineer
EMEA | Amsterdam
Optimizely
mvinter 04-29-15
 

Re: Variation of Popup and No-Popup

Hi Mario

 

It works Smiley Surprised

 

Thank you so much!!!

 

Kind regards

Martin

Level 1

Re: Variation of Popup and No-Popup

Hi there - is there a variation to this code that would allow for the window to be closed when the user clicks outside of it?

Thanks! Justin