Skip to content

Instantly share code, notes, and snippets.

@liamr
Created May 20, 2013 10:18
Show Gist options
  • Save liamr/5611461 to your computer and use it in GitHub Desktop.
Save liamr/5611461 to your computer and use it in GitHub Desktop.
Flexslider behavior example
/**
* BEHAVIOR: SLIDES
*/
define(['jquery', 'libs/jquery.flexslider-min'], function($) {
InitSlides = {
container: null,
setting: 'default',
init: function(_container){
InitSlides.container = _container;
if(InitSlides.container.attr('data-setting')){
InitSlides.setting = InitSlides.container.attr('data-setting');
} else {
InitSlides.setting = 'default';
}
var settings = false;
switch(InitSlides.setting){
case 'home' :
settings = {
controlNav: false,
directionNav: false ,
slideshowSpeed: 2000,
animationSpeed: 600,
};
break;
settings = {
controlNav: false,
directionNav: false ,
slideshowSpeed: 5000, //Integer: Set the speed of the slideshow cycling, in milliseconds
animationSpeed: 600,
};
}
log('Behavior: FlexSlider, setting: ' + InitSlides.setting);
InitSlides.container.flexslider(settings);
}
}
return InitSlides;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment