2013-08-27 2 views
3

jcarousel이 li 너비 100 %로 작동하도록하려고합니다. 즉 브라우저 창에있는 모든 너비는 li 항목의 너비이며 창을 축소하면 텍스트가 그에 따라 흐르고 여전히 슬라이더로 작동합니다.100 % 품목 너비의 jCarousel?

여기 ...

http://jsfiddle.net/kirkbross/3FhcQ/38/

+0

'ul'의 너비를 100 %로 설정했습니다. –

+1

그러면 슬라이더가 작동하지 않습니다. 컨트롤은 작동하지만 슬라이드는 변경되지 않습니다. 즉 첫 번째 슬라이드에는 "이전"컨트롤이없고 목록의 끝 부분에 도달하면 "다음"컨트롤이 사라집니다. 그래서 그것은 작동 중이지만 슬라이드는 변하지 않습니다. –

+1

문제를 재현하는 [피들] (http://jsfiddle.net)을 제공 할 수 있습니까? –

답변

0

내가 jQuery를 다음 샘플에서 가져온 사용 남겼 내 바이올린입니다 :

http://sorgalla.com/jcarousel/examples/responsive/

$(document).ready(function() { 
    var jcarousel = $('.carousel-stage'); 

    jcarousel 
     .on('jcarousel:reload jcarousel:create', function() { 
      var width = jcarousel.innerWidth(); 
      var height = jcarousel.innerHeight(); 

      if (width < 560) { 
       jcarousel.jcarousel('items').css('width', width + 'px'); 
       jcarousel.jcarousel('items').css('height', (width*0.666) + 'px'); 
      } else { 
       jcarousel.jcarousel('items').css('width', '600px'); 
       jcarousel.jcarousel('items').css('height', '400px'); 
      } 

     }) 
});   

와 CSS - 이 경우에 연결된 회전식 컨베이어의 경우

@media screen and (max-width: 660px) { 
    .connected-carousels, 
    .connected-carousels .stage, 
    .connected-carousels .navigation, 
    .connected-carousels .carousel-stage, 
    .connected-carousels .carousel-navigation, 
    .carousel-stage li img { 
     width: 100%; 
     height:auto; 
    } 
    .carousel-stage li img { 
     padding: 0; 
     margin: 0; 
     vertical-align: top; 
    } 
    .connected-carousels .prev-stage, .connected-carousels .next-stage { 
     width: 50%; 
     height: 100%; 
    } 
    .jcarousel-clip-horizontal 
    { 
     width: 100%;  
     overflow: hidden; 
    } 
}