Search code examples
jqueryflexslider

Is it possible to Randomize animation on flexslider


I know it has options to have horizontal or vertical scrolling, reverse directions, do a slide or fade. Is it possible to change these options on the fly resulting in a variety of animations within the same slider?


Solution

  • you could try something like this

      $(window).load(function() {
    
      // store the slider in a local variable
      var flexslider;
    
      /** 
       *  Animation with Fade for
       *  default
      **/
      $('.flexslider').flexslider({
          animation: "fade"
      });
    
      /**
       *  On click, directly change
       *  the public .vars within flexslider.
      **/
      $(document).on('click', function(){
          flexslider.vars.animation = "slide";
      });
    
    }); 
    

    REF:

    Reinitialise existing jQuery flexslider with new options

    FLEX SLIDER DOCS: https://github.com/woothemes/FlexSlider

    Happy Coding :)