Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 色盒刻度照片不工作_Javascript_Jquery_Html_Css_Colorbox - Fatal编程技术网

Javascript 色盒刻度照片不工作

Javascript 色盒刻度照片不工作,javascript,jquery,html,css,colorbox,Javascript,Jquery,Html,Css,Colorbox,Colorbox的scalePhotos参数似乎无法按预期工作。下面是我初始化colorbox的方法,在html末尾的结束标记之前调用: jQuery('a.screen').colorbox({ rel: 'screens', width: '960px', height: '720px', photo: 'true', speed: '1000', scalePhotos: 'true' }); 尽管这会增加colorbox的大小,但尽管将s

Colorbox的scalePhotos参数似乎无法按预期工作。下面是我初始化colorbox的方法,在html末尾的结束标记之前调用:

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:函数{ $this.colorbox.resize{innerWidth:'800px',innerHeight:'600px',scalePhoto:true}; } };

以下是一幅说明问题的图片:

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

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});
                    },
                });
});

访问以获取有关您问题的更多信息。无骰子;同样的问题。使用“调整大小”时,colorbox本身会进行缩放,但图像大小仍保持不变。