PageSourceSearch

https://www.hologic.es/themes/custom/hologic/global/js/corporate-landing-page.js?tm4wcr

js hologic.es collected 2026-10-08 20:32:50 UTC 4,327 bytes, 125 lines download raw bytes

1(function ($) {
2  'use strict';
3
4  if ($(".page-node-type-timeline").length) {
5    disableParallaxAnimation();
6    isCorporateHeroSliderTemplate();
7    isCorporateHeroVideoTemplate();
8    moveContentForSliderOnlyOnBGImgBanner();
9    moveTitleForHeroBannerVideo();
10    moveSectionIcon();
11    sectionIconIconForHeroBannerVideo()
12    moveTooltipToStatContainer();
13    smoothScroll();
14    wrapFooterLogoAndText();
15    equalWidth(".timeline__buttons a");
16
17    $(window).on('resize', function () {
18      $(".timeline__buttons a").css('width', 'auto');
19      equalWidth(".timeline__buttons a");
20    })
21  }
22
23  function disableParallaxAnimation() {
24    if ($(".field--name-field-disable-parallax-animation").length) {
25      if ($(".field--name-field-disable-parallax-animation").text() === "1") {
26        $(".view-timeline-layout").addClass("no-parallax");
27      }
28    }
29  }
30
31  function isCorporateHeroSliderTemplate() {
32    if ($(".field--name-field-template").length) {
33      if ($(".field--name-field-template").text() === "corporate-hero-slider") {
34        $(".view-timeline-layout").addClass("corporate-hero-slider corporate-template");
35      }
36    }
37  }
38
39  function isCorporateHeroVideoTemplate() {
40    if ($(".field--name-field-template").length) {
41      if ($(".field--name-field-template").text() === "corporare-hero-video") {
42        $(".view-timeline-layout").addClass("corporate-hero-video corporate-template");
43        $("body").addClass("corporate-page-template");
44      }
45    }
46  }
47
48  function moveContentForSliderOnlyOnBGImgBanner() {
49    $(".timeline-parallax").each(function() {
50      if ($(this).find(".hero-banner").length) {
51        var $firstSlide = $(this).find(".hero-banner").first();
52        $(this).append("<div class='timeline__hero-content'><div class='timeline__wrapper'></div></div>");
53        $(this).find(".timeline__hero-content .timeline__wrapper").append($firstSlide.find(".timeline__wrapper").html())
54      }
55    })
56  }
57
58  function moveTitleForHeroBannerVideo() {
59    if ($(document).find(".view-timeline-layout").hasClass("corporate-hero-video")) {
60      var $firstSection = $(".timeline-parallax").first();
61      var clonedHeroTitle = $firstSection.find(".timeline__section .timeline__content h3").clone()
62      $firstSection.find(".timeline__video").append(clonedHeroTitle)
63    }
64  }
65
66  function sectionIconIconForHeroBannerVideo() {
67    if ($(document).find(".view-timeline-layout").hasClass("corporate-hero-video")) {
68      var $firstSection = $(".timeline-parallax").first();
69      var clonedHeroTitle = $firstSection.find(".section__icon").clone();
70      $firstSection.find(".timeline__video").append(clonedHeroTitle)
71    }
72  }
73
74  function moveSectionIcon() {
75    if ($(".section__icon").length) {
76      $(".section__icon").each(function(index) {
77        if (index == 0) {
78          var $icon = $(this);
79          $(this).closest(".timeline-parallax").append($icon);
80        }
81      })
82    }
83  }
84
85  function moveTooltipToStatContainer() {
86    if ($(document).find(".view-timeline-layout").hasClass("corporate-hero-video")) {
87      $(".timeline-parallax").each(function() {
88        if ($(this).find(".timeline__section .footnote").children().length > 0) {
89          var $footnote = $(this).find(".timeline__section .footnote");
90          if ($(this).find(".timeline__stats").length) {
91            $(this).find(".timeline__stats").append($footnote);
92          }
93
94          if ($(this).find(".timeline__quote").length) {
95            $(this).find(".timeline__quote").append($footnote);
96          }
97        }
98      })
99    }
100  }
101
102  function smoothScroll() {
103    $(".timeline__wrapper a[href^='#'], .timeline__hero-content a[href^='#']").on("click", function() {
104      var elem = $(this).attr("href");
105      $("html, body").animate({
106        scrollTop: $(elem).offset().top - $(".navbar").height()
107      }, 400);
108    })
109  }
110
111  function equalWidth(item) {
112    var maxWidth = 0;
113    return $(item).each(function (index) {
114      var elemWidth = $(this).width();
115      maxWidth = Math.max(maxWidth, elemWidth);
116    }).width(maxWidth);
117  };
118
119  function wrapFooterLogoAndText() {
120    if ($(".corporate-page-template .-content-only").length) {
121      $(".corporate-page-template .-content-only").find(".logo-heading, .logo-link-img").wrapAll("<div class='content__logo-btn'></div>");
122    }
123  }
124
125})(jQuery);

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.