Automatic open Colorbox modal window
Posted
by
user1631168
on Stack Overflow
See other posts from Stack Overflow
or by user1631168
Published on 2012-08-28T18:50:07Z
Indexed on
2012/08/28
21:38 UTC
Read the original article
Hit count: 219
I'm using the Colorbox module in Drupal 7. I'm opening an external website. I can make it work with a link. Click here, then click the "colorbox popup" link at the bottom, middle column. The client would like this to open automatically when the page opens. I've created a block and added the following code (from the colorbox site).
<script type="text/javascript">
// Display a welcome message on first visit, and set a cookie that expires in 30 days:
if (document.cookie.indexOf('visited=true') === -1) {
var expires = new Date();
expires.setDate(expires.getDate()+30);
document.cookie = "visited=true; expires="+expires.toUTCString();
jQuery.colorbox({html:"http://join.raretearepublic.com/popup/", width:887, height:638});
}
</script>
But it does not work.
Any help would be greatly appreciated.
© Stack Overflow or respective owner