diff --git a/src/responsive-carousel.pagination.js b/src/responsive-carousel.pagination.js index 6cf65eb..d75b461 100644 --- a/src/responsive-carousel.pagination.js +++ b/src/responsive-carousel.pagination.js @@ -64,6 +64,8 @@ } ) // update pagination on page change .bind( "goto." + pluginName, function( e, to ){ + to = $( to ); + var index = to ? $( this ).find( "div.carousel-item" ).index( to.get( 0 ) ) : 0; $( this ).find( "ol." + paginationClass + " li" ) @@ -90,4 +92,4 @@ $( e.target )[ pluginName ]( "_createPagination" ); } ); -}(jQuery)); \ No newline at end of file +}(jQuery));