我在Drupal 7中使用Colorbox模块。我打开了一个外部网站。我可以使它与链接一起工作。点击here,然后点击底部中间一列的“colorbox popup”链接。客户希望在打开页面时自动打开。我创建了一个块并添加了以下代码(从colorbox网站)。自动打开Colorbox模式窗口
<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:"URL goes here", width:887, height:638});
}
</script>
但它不起作用。
任何帮助将不胜感激。