Carousel With Min & Max Ranges

  • Resolved
    Posted in: Jarvis WordPress  

  • Member
    Precision_Comm
    June 8, 2014 at 3:14 pm #16380

    flexslider2 seems to offer the ability to implement a carousel in the flexslider. Is the place to add the code below also in ajax_portfolio.js?

    (function() {

    // store the slider in a local variable
    var $window = $(window),
    flexslider;

    // tiny helper function to add breakpoints
    function getGridSize() {
    return (window.innerWidth < 600) ? 2 :
    (window.innerWidth < 900) ? 3 : 4;
    }

    $(function() {
    SyntaxHighlighter.all();
    });

    $window.load(function() {
    $(‘.flexslider’).flexslider({
    animation: “slide”,
    animationLoop: false,
    itemWidth: 210,
    itemMargin: 5,
    minItems: getGridSize(), // use function to pull in initial value
    maxItems: getGridSize() // use function to pull in initial value
    });
    });
    // check grid size on resize event
    $window.resize(function() {
    var gridSize = getGridSize();

    flexslider.vars.minItems = gridSize;
    flexslider.vars.maxItems = gridSize;
    });
    }());

    thank you!

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.