Colorbox scalePhotos not working

Colorbox scalePhotos not working

本文关键字:working not scalePhotos Colorbox      更新时间:2023-09-26

Colorbox的scalePhotos参数似乎没有按预期工作。下面是我如何初始化colorbox,在html结尾的</body>标签之前调用:

jQuery('a.screen').colorbox({
    rel: 'screens',
    width: '960px',
    height: '720px',
    photo: 'true',
    speed: '1000',
    scalePhotos: 'true'
});

尽管这增加了colorbox的大小,但尽管将scalePhotos设置为true,图像仍然以其默认大小显示。我还尝试设置initialWidth/Height以及编辑CSS,但似乎没有工作。

我也试过这个方法:jQuery (.screen) .colorbox ({
onComplete: function() {(这).colorbox美元。resize({innerWidth:'800px', innerHeight:'600px', scalepphoto: true});}
});

下面的图片说明了这个问题:http://punchpedia.com/cbox.png

我不确定它是否能正常工作。就试一次…

jQuery(document).ready(function(){
jQuery("a.media-gallery-thumb").colorbox({
                    onComplete:function() {
                    var x = jQuery('div.lightbox-stack div.media-gallery-item div.gallery-thumb-outer div.gallery-thumb-inner a img').width();
                    var y = jQuery('div.lightbox-stack div.media-gallery-item div.gallery-thumb-outer div.gallery-thumb-inner a img').height();
                    jQuery(this).colorbox.resize({width:x, height:y});
                    },
                });
});