(function($) { // This is the connector function. // It connects one item from the navigation carousel to one item from the // stage carousel. // The default behaviour is, to connect items with the same index from both // carousels. This might _not_ work with circular carousels! var connector = function(itemNavigation, carouselStage) { return carouselStage.jcarousel('items').eq(itemNavigation.index()); }; $(function() { // Setup the carousels. Adjust the options for both carousels here. var carouselStage = $('#jogos .carousel-stage').jcarousel(); var carouselNavigation = $('#jogos .carousel-navigation').jcarousel(); // We loop through the items of the navigation carousel and set it up // as a control for an item from the stage carousel. carouselNavigation.jcarousel('items').each(function() { var item = $(this); // This is where we actually connect to items. var target = connector(item, carouselStage); item .on('active.jcarouselcontrol', function() { carouselNavigation.jcarousel('scrollIntoView', this); item.addClass('active'); }) .on('inactive.jcarouselcontrol', function() { item.removeClass('active'); }) .jcarouselControl({ target: target, carousel: carouselStage }); }); // Setup controls for the stage carousel $('#jogos .prev-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#jogos .next-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); // Setup controls for the navigation carousel $('#jogos .prev-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#jogos .next-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); }); })(jQuery); (function($) { // This is the connector function. // It connects one item from the navigation carousel to one item from the // stage carousel. // The default behaviour is, to connect items with the same index from both // carousels. This might _not_ work with circular carousels! var connector = function(itemNavigation, carouselStage) { return carouselStage.jcarousel('items').eq(itemNavigation.index()); }; $(function() { // Setup the carousels. Adjust the options for both carousels here. var carouselStage = $('#acessorios .carousel-stage').jcarousel(); var carouselNavigation = $('#acessorios .carousel-navigation').jcarousel(); // We loop through the items of the navigation carousel and set it up // as a control for an item from the stage carousel. carouselNavigation.jcarousel('items').each(function() { var item = $(this); // This is where we actually connect to items. var target = connector(item, carouselStage); item .on('active.jcarouselcontrol', function() { carouselNavigation.jcarousel('scrollIntoView', this); item.addClass('active'); }) .on('inactive.jcarouselcontrol', function() { item.removeClass('active'); }) .jcarouselControl({ target: target, carousel: carouselStage }); }); // Setup controls for the stage carousel $('#acessorios .prev-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#acessorios .next-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); // Setup controls for the navigation carousel $('#acessorios .prev-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#acessorios .next-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); }); })(jQuery); (function($) { // This is the connector function. // It connects one item from the navigation carousel to one item from the // stage carousel. // The default behaviour is, to connect items with the same index from both // carousels. This might _not_ work with circular carousels! var connector = function(itemNavigation, carouselStage) { return carouselStage.jcarousel('items').eq(itemNavigation.index()); }; $(function() { // Setup the carousels. Adjust the options for both carousels here. var carouselStage = $('#consoles .carousel-stage').jcarousel(); var carouselNavigation = $('#consoles .carousel-navigation').jcarousel(); // We loop through the items of the navigation carousel and set it up // as a control for an item from the stage carousel. carouselNavigation.jcarousel('items').each(function() { var item = $(this); // This is where we actually connect to items. var target = connector(item, carouselStage); item .on('active.jcarouselcontrol', function() { carouselNavigation.jcarousel('scrollIntoView', this); item.addClass('active'); }) .on('inactive.jcarouselcontrol', function() { item.removeClass('active'); }) .jcarouselControl({ target: target, carousel: carouselStage }); }); // Setup controls for the stage carousel $('#consoles .prev-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#consoles .next-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); // Setup controls for the navigation carousel $('#consoles .prev-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#consoles .next-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); }); })(jQuery); (function($) { // This is the connector function. // It connects one item from the navigation carousel to one item from the // stage carousel. // The default behaviour is, to connect items with the same index from both // carousels. This might _not_ work with circular carousels! var connector = function(itemNavigation, carouselStage) { return carouselStage.jcarousel('items').eq(itemNavigation.index()); }; $(function() { // Setup the carousels. Adjust the options for both carousels here. var carouselStage = $('#conteudo .carousel-stage').jcarousel(); var carouselNavigation = $('#conteudo .carousel-navigation').jcarousel(); // We loop through the items of the navigation carousel and set it up // as a control for an item from the stage carousel. carouselNavigation.jcarousel('items').each(function() { var item = $(this); // This is where we actually connect to items. var target = connector(item, carouselStage); item .on('active.jcarouselcontrol', function() { carouselNavigation.jcarousel('scrollIntoView', this); item.addClass('active'); }) .on('inactive.jcarouselcontrol', function() { item.removeClass('active'); }) .jcarouselControl({ target: target, carousel: carouselStage }); }); // Setup controls for the stage carousel $('#conteudo .prev-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#conteudo .next-stage') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); // Setup controls for the navigation carousel $('#conteudo .prev-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '-=1' }); $('#conteudo .next-navigation') .on('inactive.jcarouselcontrol', function() { $(this).addClass('inactive'); }) .on('active.jcarouselcontrol', function() { $(this).removeClass('inactive'); }) .jcarouselControl({ target: '+=1' }); }); })(jQuery);