PageSourceSearch

https://www.zendrop.com/wp-content/plugins/zendrop-elementor-blocks/assets/js/script.js?ver=3.5.5

js zendrop.com collected 2026-10-02 14:40:18 UTC 8,224 bytes, 250 lines download raw bytes

1(function ($) {
2  $(document).ready(function () {
3    // Initialize Zendrop Testimonials with delay for Elementor
4    setTimeout(function () {
5      initZendropTestimonials();
6    }, 500);
7
8    function initZendropTestimonials() {
9      // Initialize mobile slider if it exists
10      if ($(".zendrop-testimonials-slider").length > 0) {
11        var $slider = $(".zendrop-testimonials-slider");
12
13        $slider.slick({
14          slidesToShow: 1,
15          slidesToScroll: 1,
16          dots: true,
17          arrows: false,
18          autoplay: false, // Start with autoplay off
19          autoplaySpeed: 5000,
20          adaptiveHeight: true,
21          infinite: true,
22          responsive: [
23            {
24              breakpoint: 768,
25              settings: {
26                slidesToShow: 1,
27                slidesToScroll: 1,
28              },
29            },
30          ],
31        });
32
33        // Auto-play video only on first slide for mobile
34        if (window.innerWidth <= 768) {
35          // Start autoplay only for first slide
36          setTimeout(function () {
37            var $firstSlide = $slider.find(
38              '.slick-slide[data-slick-index="0"]'
39            );
40            var $firstVideo = $firstSlide.find(
41              ".zendrop-video-thumbnail-preview"
42            )[0];
43            if ($firstVideo) {
44              $firstVideo.muted = true;
45              $firstVideo.play();
46            }
47          }, 1000);
48        }
49
50      }
51
52      // Handle testimonial item hover to play video thumbnail
53      $(".zendrop-testimonial-item")
54        .on("mouseenter", function () {
55          var $item = $(this);
56          var $thumbnail = $item.find(".zendrop-testimonial-video-thumbnail");
57          var $video = $thumbnail.find(".zendrop-video-thumbnail-preview")[0];
58
59          if ($video) {
60            // Hide unmute button
61            $thumbnail.find(".zendrop-video-unmute-button").fadeOut(200);
62
63            // Always start muted to comply with autoplay policies
64            $video.muted = true;
65            $video.play();
66          }
67        })
68        .on("mouseleave", function () {
69          var $item = $(this);
70          var $thumbnail = $item.find(".zendrop-testimonial-video-thumbnail");
71          var $video = $thumbnail.find(".zendrop-video-thumbnail-preview")[0];
72          var $unmuteButton = $thumbnail.find(".zendrop-video-unmute-button");
73
74          if ($video) {
75            // Pause video and reset to show poster/thumbnail
76            $video.pause();
77            $video.currentTime = 0;
78            $video.muted = true;
79            $video.load(); // This will reset the video to show the poster attribute
80
81            // Reset button opacity and show it again
82            $unmuteButton.css("opacity", "0.7");
83            $unmuteButton.fadeIn(200);
84          }
85        });
86
87      // Handle video thumbnail click to toggle mute
88      $(".zendrop-testimonial-video-thumbnail").on("click", function (e) {
89        e.stopPropagation(); // Prevent event bubbling
90
91        var $thumbnail = $(this);
92        var $video = $thumbnail.find(".zendrop-video-thumbnail-preview")[0];
93        var $button = $thumbnail.find(".zendrop-video-unmute-button");
94
95        if ($video) {
96          if ($video.muted) {
97            $video.muted = false;
98
99            // Ensure video is playing when unmuted
100            var playPromise = $video.play();
101            if (playPromise !== undefined) {
102              playPromise
103                .then(function () {
104                  // Video started playing successfully
105                  $button.css("opacity", "1");
106                })
107                .catch(function (error) {
108                  // Auto-play was prevented, mute it again
109                  $video.muted = true;
110                  $button.css("opacity", "0.7");
111                });
112            } else {
113              $button.css("opacity", "1");
114            }
115          } else {
116            $video.muted = true;
117            $button.css("opacity", "0.7");
118          }
119        }
120      });
121    }
122
123    // Find each services tabs container and initialize separately
124    $(".zendrop-services-tabs").each(function (index) {
125      var $container = $(this);
126      var $tabs = $container.find(".slick-tabs");
127      var $content = $container.find(".slider-nav");
128
129      // Initialize content slider with the new settings
130      $content.slick({
131        slidesToShow: 1,
132        slidesToScroll: 1,
133        variableWidth: true, // Switch back to variableWidth to maintain full slide visibility
134        adaptiveHeight: false,
135        dots: false,
136        centered: false,
137        arrows: false,
138        infinite: true,
139        asNavFor: $tabs,
140      });
141
142      // Initialize tabs slider with the new settings
143      $tabs.slick({
144        slidesToShow: 1,
145        slidesToScroll: 1,
146        dots: false,
147        arrows: false,
148        infinite: true,
149        variableWidth: true,
150        focusOnSelect: true,
151        asNavFor: $content,
152      });
153
154      // Function to equalize slide heights based on the tallest slide
155      function equalizeSlideHeights() {
156        var $allSlides = $container.find(".zendrop-tab-content");
157
158        // First reset heights to get natural heights
159        $allSlides.css("height", "auto");
160
161        // Calculate the tallest slide height
162        var maxHeight = 0;
163        $allSlides.each(function () {
164          var slideHeight = $(this).outerHeight();
165          maxHeight = Math.max(maxHeight, slideHeight);
166        });
167
168        // Set all slides to the tallest height
169        if (maxHeight > 0) {
170          $allSlides.css("height", maxHeight + "px");
171          $content.slick("setPosition"); // Refresh slick to apply the height change
172        }
173      }
174
175      // Apply equal heights after initialization
176      setTimeout(equalizeSlideHeights, 200);
177
178      // Re-apply when window is resized
179      $(window).on("resize", function () {
180        setTimeout(equalizeSlideHeights, 200);
181      });
182
183      // Wait for all images to load before final height calculation
184      $container.find("img").on("load", function () {
185        equalizeSlideHeights();
186      });
187    });
188
189    // Sticky header functionality
190    const header = document.querySelector("table thead");
191    const table = document.querySelector("table");
192
193    // Check if both table and header exist
194    if (table && header) {
195      $(window).on("scroll", function () {
196        const rect = table.getBoundingClientRect();
197
198        if (rect.top <= 70 && rect.bottom >= header.clientHeight + 70) {
199          $(header).addClass("sticky-header");
200        } else {
201          $(header).removeClass("sticky-header");
202        }
203      });
204    }
205  });
206})(jQuery);
207
208document.addEventListener("DOMContentLoaded", function () {
209  const unmuteButton = document.querySelector("#unmute-vimeo");
210  if (unmuteButton) {
211    unmuteButton.addEventListener("click", function () {
212      const iframe = document.querySelector("#main-vimeo");
213      
214      // Initialize everything on click
215      if (iframe && typeof Vimeo !== 'undefined') {
216        try {
217          // Create new player instance
218          const player = new Vimeo.Player(iframe);
219          
220          // Immediately set volume to unmute
221          player.setVolume(1)
222            .then(function (volume) {
223              
224              // Hide different elements based on device
225              if (window.innerWidth <= 768) {
226                // Mobile: Hide unmute button and set overlay margin-top to 0
227                unmuteButton.style.display = "none";
228                const overlayElement = document.querySelector("#vimeo-overlay");
229                if (overlayElement) {
230                  overlayElement.style.marginTop = "0";
231                }
232              } else {
233                // Desktop: Hide overlay
234                const overlayElement = document.querySelector("#vimeo-overlay");
235                if (overlayElement) {
236                  overlayElement.style.display = "none";
237                }
238              }
239            })
240            .catch(function (error) {
241              console.error("Error unmuting video:", error);
242            });
243            
244        } catch (error) {
245          console.error("Error initializing Vimeo player:", error);
246        }
247      }
248    });
249  }
250});

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.