Created
November 11, 2014 20:13
-
-
Save niallthompson/87ec727df4950a264d35 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$(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