【问题标题】:How to show variable width images inside carouFredSel?如何在 carouFredSel 中显示可变宽度的图像?
【发布时间】:2013-04-24 05:06:55
【问题描述】:

当我们在 css 肖像照片中设置 img 宽度时会拉伸。当我们不设置 img 宽度时,carouFredSel 会在当前图像旁边显示其他图像的部分。我们如何才能在固定宽度的轮播中只显示一张(人像)照片?

----js-----

$('#carousel').carouFredSel({
        width: '100%',

        items: {
            visible: 3,
            minimum: 1,
            start: 0,
            width: '100%',
            align:'center'
        },
        scroll: {
            items: 1,
            duration: 800,
            timeoutDuration: 3000
        },
        prev: '#prev',
        next: '#next',
        pagination: {
            container: '#pager',
            deviation: 0
        },
        auto: {
            pauseOnHover: true
        }
    });

-------css------------

#carousel img {
display: block;
float: left;
/*width: 978px;*/
height: 652px;
background: white;
text-align: center;

}

【问题讨论】:

    标签: caroufredsel


    【解决方案1】:

    希望我理解正确。以下内容应使图像居中而不调整包含元素的大小

        $("#carousel").carouFredSel({
        width: "auto",
        height: "variable"  
    })
    

    而以下内容会将包含元素的大小调整为图像的宽度

        $("#carousel").carouFredSel({
        width: "variable",
        height: "variable"  
    })
    

    【讨论】:

      猜你喜欢
      • 2013-09-14
      • 2017-09-22
      • 1970-01-01
      • 2019-11-11
      • 2015-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-29
      相关资源
      最近更新 更多