Colorbox iframe无法正确加载 - jQuery

时间:2013-02-04 17:41:52

标签: jquery colorbox

我正在使用Colorbox进行项目,它似乎工作得很好。我只是无法让“Iframe”版本工作?我究竟做错了什么?我可以不用iframe加载.html吗?我需要它是iframe,因为它正在加载一个简报形式。

            $(document).ready(function(){

            // Display a welcome message on first visit, and set a cookie that expires in 30 days:
            if (document.cookie.indexOf('visited=false') === -1) {
            var expires = new Date();
            expires.setDate(expires.getDate()+30);
            document.cookie = "visited=true; expires="+expires.toUTCString();

            $.colorbox({iframe:true, href:"test.html"})
            }

        });

1 个答案:

答案 0 :(得分:0)

我做了一个错误的组合:

$.colorbox({iframe:true, href:'test.html'})

它必须如下所示:

$.colorbox({href:'test.html', iframe:true, width:'400px',height:'250px'})

我真的不知道为什么,如果有人想澄清它,欢迎你。我只知道它解决了我的问题。

相关问题