Javascript 如何在jquery colorbox中自定义#cboxLoadedContent的宽度

Javascript 如何在jquery colorbox中自定义#cboxLoadedContent的宽度,javascript,jquery,css,colorbox,Javascript,Jquery,Css,Colorbox,我正在使用jquery插件colorbox 我在尝试设置div#cboxLoadedContent的宽度和高度时遇到了一个问题,它是cboxContent div的子级,默认情况下使用框大小,我不知道colorbox如何计算此div的宽度和高度。 例如,我有父div: <div id="cboxContent" style="float: left; width:572px; height:396px;"> 我可以在cboxLoadedContent中拥有相同的cboxcon

我正在使用jquery插件colorbox

我在尝试设置div#cboxLoadedContent的宽度和高度时遇到了一个问题,它是cboxContent div的子级,默认情况下使用框大小,我不知道colorbox如何计算此div的宽度和高度。 例如,我有父div:

<div id="cboxContent" style="float: left; width:572px; height:396px;">

我可以在cboxLoadedContent中拥有相同的cboxcontent值吗


提前谢谢

请尝试以下操作。考虑到这会触发所有带有
class=“group”

可以用%或px值表示宽度和高度


希望这有帮助。

谢谢你的回答

事实上,我没有使用
rel:'group'

这是我的代码:

var popin_width = '572';
var popin_height = '416';
if( $('.ie8, .ie7').length )
{
    popin_height = '417';
}
if( $('.ie7').length )
{
    popin_height = '427';
}


$('.popin').colorbox({
    inline: true,
    width: popin_width,
    height: popin_height,
    opacity: 0.8,
    overlayClose: true,
    close: 'Fermer',
    onOpen: function() {
        $('a, :input, object').attr('tabindex', '-1');
    },
            onClosed: function() {
        $('a, :input, object').attr('tabindex', '0');
    }
});
var popin_width = '572';
var popin_height = '416';
if( $('.ie8, .ie7').length )
{
    popin_height = '417';
}
if( $('.ie7').length )
{
    popin_height = '427';
}


$('.popin').colorbox({
    inline: true,
    width: popin_width,
    height: popin_height,
    opacity: 0.8,
    overlayClose: true,
    close: 'Fermer',
    onOpen: function() {
        $('a, :input, object').attr('tabindex', '-1');
    },
            onClosed: function() {
        $('a, :input, object').attr('tabindex', '0');
    }
});