No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

50 líneas
1.3 KiB

  1. const $ = global.$;
  2. import 'jquery.easing';
  3. import Slider from "../slider/slider";
  4. class IHKMHSlider {
  5. constructor(section) {
  6. this.section = section.addClass('initiated');
  7. this.slider = new Slider(section);
  8. this.slider.settings = {
  9. loop: true,
  10. autoplay: true,
  11. infinite: true,
  12. autoplaySpeed: 7000,
  13. animationSpeed: 600,
  14. startSlide: 1,
  15. };
  16. this.slider.handleAutoplay();
  17. this.section.on('slide-change', () => this.syncHeights());
  18. requestAnimationFrame(() => this.syncHeights());
  19. $(window).on('resize', () => this.syncHeights());
  20. }
  21. syncHeights() {
  22. if (!this.section.closest('.hero-fullwidth').length) return;
  23. this.section.find('.slide').each(function () {
  24. const textBox = $(this).find('.text-box');
  25. const textInImageBox = $(this).find('.text-in-image-box');
  26. if ($(window).width() > 999) {
  27. textInImageBox.height(textBox.innerHeight() - 36);
  28. } else {
  29. textInImageBox.css('height', '');
  30. }
  31. });
  32. }
  33. }
  34. export default IHKMHSlider;
  35. $('body').on('ihk-init dynamic-component-loaded gfi-dynamic-init', function () {
  36. $('.slider:not(.initiated)').each(function () {
  37. new IHKMHSlider($(this));
  38. });
  39. });