Colorbox“此内容加载失败。”错误

问题描述 投票:0回答:1

我需要在页面加载时加载带有 colorbox 的订阅表单。Colorbox 在页面加载时打开,但在内部我只看到一条错误消息“此内容无法加载。”。 这是我使用的代码

JS

jQuery(document).ready(function($) {
    $('.colorbox5').colorbox({open:true, href:'div#content5'});  
    });
    ....

HTML

   <body>
       <div style="display:none;">
        <div id="content5" class="colorbox5">
        ... my form here
        </div>
       </div>

有人可以帮我解决这个问题吗? (我正在使用 Drupal)

drupal load colorbox
1个回答
0
投票

在“内容类型”下查看here,您需要告诉 colorbox 它正在显示内联内容。所以,我认为你需要这个:

$('.colorbox5').colorbox({open:true, href:'div#content5', inline:true,});

© www.soinside.com 2019 - 2024. All rights reserved.