Skip to content

Instantly share code, notes, and snippets.

@haingdc
Created February 24, 2018 14:24
Show Gist options
  • Select an option

  • Save haingdc/ec3a8f5546fc8b1c951b8c445358c14f to your computer and use it in GitHub Desktop.

Select an option

Save haingdc/ec3a8f5546fc8b1c951b8c445358c14f to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 1
function initialiseCarousel(id, frequency) {
var el = document.getElementById(id);
var slider = new Carousel(el, frequency);
slider.init();
return slider;
}
initialiseCarousel('main-carousel', 3000);
initialiseCarousel('news-carousel', 5000);
initialiseCarousel('events-carousel', 7000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment