ryrych / rcarousel

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

Getting error on less than 3 images vertical scroller - simulated by using veritcal scroller example provided. #50

Open GrahamFClark opened 12 years ago

GrahamFClark commented 12 years ago

I'm getting this error in the Firebug console when adding only two images.

TypeError: data.lastPage[i] is undefined error source line: [Break On This Error]
if ( data.lastPage[i].get(0) === page[i].get(0) ) {

Code @ Line 283 in jquery.ui.rcarousel.js

I recreated it in one of your examples - vertical.html. I removed all but two images in the carousel and voila problem occured.

Carousel Version 1.1.3

Thanks

mikecaines commented 11 years ago

I ran into this when the configuration option for "visible" or "step" was set to a larger value than the number of actual images in the list, and when the items in the list were 's not 's.

ashu4code commented 11 years ago

change your step and visible to count ur dynamic array..
$(function(){ $("#carosel-out").rcarousel({ step:<?php echo $countvisible; ?>, visible: <?php echo $countvisible; ?>, orientation: "vertical", width: 210, navigation: { next: "#ui-carousel-next1", prev: "#ui-carousel-prev1" }

    });
        $("#ui-carousel-next1")
        .add("#ui-carousel-prev1")
        .hover(
            function(){
                $(this).css("opacity", 0.7 );
            },
            function(){
                $(this).css("opacity", 1.0 );
            }
        );                  
});