You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
859 B

  1. import $ from 'jquery';
  2. import 'jquery.easing';
  3. import Slider from "../slider/slider";
  4. class IHKMHSlider {
  5. constructor(section) {
  6. this.section = section.addClass('initiated');
  7. this.slides = section.children();
  8. this.slider = new Slider(section);
  9. this.stringLength = 0;
  10. this.settings = {
  11. loop: true,
  12. autoplay: true,
  13. infinite: true,
  14. autoplaySpeed: 1000,
  15. animationSpeed: 600,
  16. startSlide: 1,
  17. };
  18. this.slider.section.on('in-viewport slide-change', () => {
  19. const curr = this.slider.currentSlide;
  20. if (this.slides[curr].hasCounter) {
  21. this.startCounter(curr);
  22. }
  23. })
  24. }
  25. }
  26. export default IHKMHSlider;
  27. $('body').on('ihk-init dynamic-component-loaded gfi-dynamic-init', function () {
  28. $('.slider:not(.initiated)').each(function() {
  29. new IHKMHSlider($(this));
  30. });
  31. });