Created
May 20, 2013 10:18
-
-
Save liamr/5611461 to your computer and use it in GitHub Desktop.
Flexslider behavior example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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