ryrych / rcarousel

yet another jQuery UI carousel
http://ryrych.github.com/rcarousel/
171 stars 48 forks source link

Elements not displaying when too few elements... #6

Closed ghost closed 12 years ago

ghost commented 12 years ago

I use rcarousel to display thumbnails of videos. I set visible elements to 7, but when I have less than 7 elements in the carousel div, nothing is displayed. When I have 7 or more elements, that's ok. Is there something I can do to display the elements when I have less than 7? Here is the code of the page and the code of the rcarousel configuration.

<div class="scrollable">   

   <!-- root element for the items -->
   <div class="items">
    <div id="container">
        <div id="carousel">
        <a href="#" class="miniature"><img src="http://i.ytimg.com/vi/bJislhIFTw4/default.jpg" alt=""/><p>PEOPLE ARE AWESOME (Brodie's Frisbee Version)</p></a>
                   <a href="#" class="miniature"><img src="http://b.vimeocdn.com/ts/210/452/210452577_200.jpg" alt=""/><p>Quechua - Grand Raid de la Réunion 2011</p></a>
                  <a href="#" class="miniature"><img src="http://b.vimeocdn.com/ts/162/938/162938637_200.jpg" alt=""/><p>Projet CHORUS</p></a>
                  <a href="#" class="miniature"><img src="http://b.vimeocdn.com/ts/208/744/208744860_200.jpg" alt=""/><p>Quechua - We all need warmth - Making Of</p></a>
                  <a href="#" class="miniature"><img src="http://b.vimeocdn.com/ts/207/501/207501960_200.jpg" alt=""/><p>Quechua - We all need warmth</p></a>
                  <a href="#" class="miniature"><img src="http://b.vimeocdn.com/ts/170/566/170566906_200.jpg" alt=""/><p>INDIA</p></a>
        </div>
    </div>   
   </div>
</div>
ryrych commented 12 years ago

Because you have to add at least ‘visible’ elements. Otherwise the error message is generated – turn on Firebug or other developer’s tool to see this message.

ghost commented 12 years ago

Thanks for your answer! What do you mean bye "You have to add at least 'visible' elements"?

The error message I got: "Uncaught TypeError: Cannot call method 'get' of undefined (jquery.ui.rcarousel.js:281)"

ryrych commented 12 years ago

When you set number of visible to 7, you have to add at least 7 elements for rcarousel to work. As you know, the purpose of every carousel is to scroll elements. It is pointless when carousel stands still, isn't it?

Oh sorry, the error message used to be there in the previous version but now it is gone. Anyway I think that I should add the information to the documentation that ‘visible’ option is the minimum number a carousel should contain.

ghost commented 12 years ago

Ok! I understand! Thanks again for your help!