PageSourceSearch

https://stahlin.com/themes/custom/robroy/js/slider.js?v=1.0.0

js stahlin.com collected 2026-09-29 09:26:05 UTC 1,849 bytes, 68 lines download raw bytes

1function updateTallestSlider() {
2  const sliders = document.querySelectorAll('.home-banner');
3  const parentSlider = document.querySelector('#home-banner-carousel-section');
4  let maxiHeight = 0;
5
6  if (!parentSlider || !sliders.length) {
7    return;
8  }
9
10  parentSlider.style.height = '';
11
12  sliders.forEach(slider => {
13    slider.style.minHeight = '';
14    slider.style.height = '';
15  });
16
17  sliders.forEach(slider => {
18    const height = slider.offsetHeight;
19    if (height > 0 && height > maxiHeight) {
20      maxiHeight = height;
21    }
22  });
23
24  parentSlider.style.height = (maxiHeight - 1) + 'px';
25
26  sliders.forEach(slider => {
27    slider.style.height = maxiHeight + 'px';
28  });
29
30  alignArrowsToContainer(parentSlider);
31}
32
33function alignArrowsToContainer(parentSlider) {
34  const slick = parentSlider.querySelector('.slick');
35  const container = parentSlider.querySelector('.home-banner > .container');
36
37  if (!slick || !container) {
38    return;
39  }
40
41  const slickBox = slick.getBoundingClientRect();
42  const containerBox = container.getBoundingClientRect();
43  const containerStyle = getComputedStyle(container);
44
45  const left = containerBox.left + parseFloat(containerStyle.paddingLeft);
46  const right = containerBox.right - parseFloat(containerStyle.paddingRight);
47
48  parentSlider.style.setProperty('--slider-arrow-left', (left - slickBox.left) + 'px');
49  parentSlider.style.setProperty('--slider-arrow-right', (slickBox.right - right) + 'px');
50}
51
52const debouncedUpdate = debounce(updateTallestSlider, 200);
53
54window.addEventListener('load', () => {
55  updateTallestSlider();
56
57  setTimeout(updateTallestSlider, 500);
58});
59
60window.addEventListener('resize', debouncedUpdate);
61
62function debounce(fn, delay) {
63  let timer = null;
64  return function(...args) {
65    clearTimeout(timer);
66    timer = setTimeout(() => fn.apply(this, args), delay);
67  };
68}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.