Vinay Raghu
Vinay Raghu

Reputation: 1279

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?

Upvotes: 0

Views: 483

Answers (1)

dreamweiver
dreamweiver

Reputation: 6002

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 :)

Upvotes: 1

Related Questions