Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.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
Wordpress CarouFREDSel插件:媒体查询在旋转木马中触发可调整大小的图像_Wordpress_Caroufredsel - Fatal编程技术网

Wordpress CarouFREDSel插件:媒体查询在旋转木马中触发可调整大小的图像

Wordpress CarouFREDSel插件:媒体查询在旋转木马中触发可调整大小的图像,wordpress,caroufredsel,Wordpress,Caroufredsel,我将此旋转木马作为wordpress插件,如下所示(全浏览器窗口宽度): 调整浏览器窗口的大小时,图像的大小保持不变,直到触发媒体查询: @media screen and (min-width: 1470px) { #image-carousel { height: 500px; } #carousel-images img { width: 980px; height: 500px; } #prev, #next { height: 500px; } #p

我将此旋转木马作为wordpress插件,如下所示(全浏览器窗口宽度):

调整浏览器窗口的大小时,图像的大小保持不变,直到触发媒体查询:

@media screen and (min-width: 1470px) {
    #image-carousel { height: 500px; }
    #carousel-images img { width: 980px; height: 500px; }

    #prev, #next { height: 500px; }
    #prev { left: -490px; }
    #next { right: -490px; }
}

@media screen and (min-width: 500px) and (max-width: 1470px) {
    #image-carousel { height: 383px; }
    #carousel-images img { width: 750px; height: 383px; }

    #prev, #next { height: 383px; }
    #prev { left: -375px; }    
    #next { right: -375px; }
}
然后,我调整需要调整大小的div的大小,图像会正确缩小,但会发生这种情况: 这些图像是“不居中的”。在创建旋转木马时发生的某些过程不会被触发(自然)。我现在解决这个问题的方法是:(我知道javascript并不枯燥,这只是一个例子)

onCreate:函数(数据){
$(窗口)。调整大小(函数(){
如果($(窗口).width()>1470){
$(“.dev7 caroufredsel carousel”).caroufredsel({
//再次创建旋转木马。。。
});
}else if($(窗口).width()
onCreate: function (data) {
    $(window).resize( function () {
        if( $(window).width() > 1470 ) {
            $(".dev7-caroufredsel-carousel").carouFredSel({
                // Create the carousel again...    
            });
        } else if ( $(window).width() <= 1470 ) {
            $(".dev7-caroufredsel-carousel").carouFredSel({
                // Create the carousel again...    
            });
        }
    });
}