Forums Carousel

set attributes

Subscribe to set attributes 5 post(s), 2 voice(s)

 
Avatar mig 3 post(s)

hi …
really nice work here ..
i have a small problem, and hope someone can help me with it ..
iam trying to set the NBVISIBLE : Number of visible elements, it’s a float ..
but it is not working ..
could anybody please tell me how to set this attribute ?
iam trying this :

<script type="js">

      function runTest() {
        var ul = $$("#horizontal_carousel .container ul").first();
     horizontal_carousel.nbVisible=2;
  // Fill carousel
        var html = $R(0,31).inject("", function(html, index)  {
          return html + '<li><img alt="Image'+ index + '" src="../../assets/images/image' +
            index + '.png"/>Image #' + index + "</li>";
        });
        ul.update(html);

    new UI.Carousel("horizontal_carousel");
    }
      Event.observe(window, "load", runTest);


but not working ..
thanks in advance
 
Avatar Seb Administrator 133 post(s)
horizontal_carousel.nbVisible=2;

What does it mean?
Carousel finds by itself nbVisible, it depends on your carousel and its elements sizes

 
Avatar mig 3 post(s)

hi Seb ..
thanks for your reply ..
would you please tell me how to set the nbVisible then ?
i am using the example found in the /test/functional/carousel/test_classic_theme.html ..
i just want to set the nbVisible to 3 items ..
could you help me please ?
thanks in advance

 
Avatar Seb Administrator 133 post(s)

Change in CSS width of #horizontal_carousel (to 448px) and #horizontal_carousel .container (to 375px)

 
Avatar mig 3 post(s)

thanks for the help ..
but is there anyway to set them from the javascript call ?
how can i make smthg like this works :

new UI.Carousel(“vertical_carousel”, {direction:”vertical”,scrollInc: 3,nbVisible: 5});

the scrollInc is set now to 3 and it works,
but how to set the nbVisible now to 5 ??
thanks again ..

Forums Carousel