Skip to content

Instantly share code, notes, and snippets.

@niallthompson
Created November 11, 2014 20:13
Show Gist options
  • Save niallthompson/87ec727df4950a264d35 to your computer and use it in GitHub Desktop.
Save niallthompson/87ec727df4950a264d35 to your computer and use it in GitHub Desktop.
$(window).load(function(){
$('.flexslider').flexslider({
animation: "fade",
animationLoop: false,
directionNav: false,
controlNav: false,
slideshow: false,
itemWidth: 600,
itemMargin: 0,
pausePlay: false,
start: function(slider){
$('body').removeClass('loading');
}
});
});
var d3 = d3 || {};
d3.flexsliderMove = function(count) {
$('.flexslider').flexslider(Math.floor(count));
}
d3.flexsliderStep = function(direction) {
if(direction < 0) $('.flexslider').flexslider("next");
else if( direction > 0) $('.flexslider').flexslider("prev");
else $('.flexslider').flexslider(0);
}
$('.move').on('click', function() {
act = $(this).data('act');
c = $(this).data('c');
if(act == 'move') {
d3.flexsliderMove(c);
} else {
d3.flexsliderStep(c);
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment