繁体   English   中英

JSSOR(jQuery插件)的缩略图图像大小

[英]Thumbnail image size for JSSOR (jQuery Plugin)

我正在使用http://www.jssor.com/的jQuery图像滑块插件。 现在,插件需要滑块中缩略图的宽度和高度。

我想知道我可以为每个图像设置不同的缩略图图像大小,因为我有不同大小的图像,固定的宽度和高度将改变图像比例。

<div u="slides" style="cursor: move;">
            <div u="prototype" class="p" style="POSITION: absolute; WIDTH: 100px; HEIGHT: 50px; TOP: 0; LEFT: 0;">
                <div class="o" style="position:absolute;top:1px;left:1px;width:100px;height:50px;overflow:hidden;">
                    <ThumbnailTemplate class="b" style="width:100px;height:50px; border: none;position:absolute; TOP: 0; LEFT: 0;"></ThumbnailTemplate>
                    <div class="i"></div>
                    <ThumbnailTemplate class="f" style="width:100px;height:50px;border: none;position:absolute; TOP: 0; LEFT: 0;"></ThumbnailTemplate>
                </div>
            </div>
</div>

请更换

<div>
    <img u="image" src="../img/alila/01.jpg" />
    <img u="thumb" src="../img/alila/thumb-01.jpg" />
</div>

<div>
    <img u="image" src="../img/alila/01.jpg" />
    <div u="thumb">
        <div style="width: 100%; height: 100%; background-image: url(../img/alila/thumb-01.jpg); background-position: center center; background-repeat: no-repeat; ">
        </div>
    </div>
</div>

添加background-size: cover; background-size: contain; 在第三个div的风格基于jssor的答案可以改变比例。 意思是:

<div>
 <img u="image" src="../img/alila/01.jpg" />
 <div u="thumb">
    <div style="width: 100%; height: 100%; background-image: url(../img/alila/thumb-01.jpg); background-position: center center; background-repeat: no-repeat; ">
 </div>
</div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM