简体   繁体   English

如何让jCarousel的宽度为100%而不是在px中指定?

[英]How can I make jCarousel to have width 100% instead of specifing in px?

I am working on asp.net and Jquery. 我正在研究asp.net和Jquery。 I tried many carousel but they all need to specify the width in px. 我尝试了很多旋转木马,但他们都需要在px中指定宽度。 Doing so my website looks abnormal on different resolution. 这样做我的网站在不同的分辨率上看起来异常 How can I make it to occupy the whole width available to it? 如何让它占据整个可用宽度?

Has any one know any other plugin which is easy and support this function? 有没有人知道任何其他容易并支持此功能的插件?

You can by remove the width on the container and set the clip to 100% on the css as: 您可以通过移除容器上的宽度并将剪辑设置为css上的100%:

.jcarousel-container-horizontal 
{
    /* width: 275px;  <--- remove it */
}

.jcarousel-clip-horizontal 
{
    width: 100%;     /*<-- set it 100%*/
    height: 75px;
}

Example: 例:

http://jsfiddle.net/hgYmt/ http://jsfiddle.net/hgYmt/

base on this demo page : http://sorgalla.com/projects/jcarousel/examples/static_simple.html 基于此演示页面: http//sorgalla.com/projects/jcarousel/examples/static_simple.html

Because I can't modify the css files, I use the important, but the idea is the same. 因为我无法修改css文件,我使用的重要,但想法是一样的。

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

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