PageSourceSearch

https://spotcheck.clinic/wp-content/themes/spot-check-clinic/assets/js/custom.js?ver=2009

js spotcheck.clinic collected 2026-09-30 14:51:22 UTC 10,547 bytes, 391 lines download raw bytes

1var page = 1;
2jQuery(document).ready(function ($) {
3
4
5  $("#all").prop("checked", true);
6
7  function submitFilters() {
8    // Get selected categories
9    var categoryFilters = [];
10    $('input[name="category[]"]:checked').each(function () {
11      categoryFilters.push($(this).val());
12    });
13    // AJAX request to filter data
14    $.ajax({
15      type: "POST",
16      url: custom.ajaxurl, // Use the AJAX URL passed from wp_localize_script
17      data: {
18        action: "filter_projects",
19        paged: page, // Pass the current page
20        categories: categoryFilters,
21      },
22      success: function (response) {
23        // Update the content with the filtered results
24        $("#show_resp_here").html(response);
25      },
26    });
27  }
28
29  // Attach a change event handler to the checkboxes
30  $(".js-filter-checkbox").change(function () {
31    // Uncheck all checkboxes except the one just checked
32    $(".js-filter-checkbox").not(this).prop("checked", false);
33    $("#all").prop("checked", false);
34    page = 1; // Reset page when filters change
35    submitFilters();
36  });
37
38  // Handle "All" checkbox
39  $("#all").change(function () {
40    if ($(this).prop("checked")) {
41      // Uncheck all other checkboxes
42      $(".js-filter-checkbox").not(this).prop("checked", false);
43      page = 1; // Reset page when "All" is checked
44      submitFilters();
45    }
46    // Optionally, you can add an else block here to handle when the "All" checkbox is unchecked
47  });
48
49  // Pagination click event
50  // $(document).on(
51  //   "click",
52  //   ".pagination-wrapper.spot-check-blogs a",
53  //   function (e) {
54  //     e.preventDefault();
55  //     var link = $(this).attr("href");
56  //     var contents = link.split("/");
57  //     var lastChar = link.substr(-1); // Selects the last character.
58  //     if (lastChar == "/") {
59  //       lastChar = contents[contents.length - 2];
60  //     }
61  //     page = lastChar;
62  //     submitFilters();
63  //   }
64  // );
65
66  // pagination and scroll js
67    $(document).on("click", ".pagination-wrapper.spot-check-blogs a", function (e) {
68      e.preventDefault();
69    
70      // Obtain the pagination link
71      var link = $(this).attr("href");
72    
73      // Check if the link is valid
74      if (link) {
75        // Define the target element
76        var showRespHereElement = $('.blog-section');
77    
78        // Scroll to the target element
79        $('html, body').animate({
80          scrollTop: showRespHereElement.offset().top - 100
81        }, 800).promise().done(function() {
82          // Animation complete, now trigger pagination after a slight delay
83          setTimeout(function() {
84            triggerPagination(link);
85          }, 200); // Adjust the delay (200 milliseconds) as needed
86        });
87      }
88    });
89    
90    function triggerPagination(link) {
91      var contents = link.split("/");
92      var lastChar = link.substr(-1); // Selects the last character.
93      if (lastChar == "/") {
94        lastChar = contents[contents.length - 2];
95      }
96      page = lastChar;
97    
98      // Ensure that the 'submitFilters()' function is available and callable
99      if (typeof submitFilters === 'function') {
100        submitFilters();
101      }
102    }
103  
104  submitFilters();
105});
106
107jQuery(document).ready(function ($) {
108  // Find the <a> tag
109  var targetLink = $(
110    'a[href="https://www.hotdoc.com.au/medical-centres/melbourne-VIC-3000/spot-check-clinic/doctors?wp=w_lightbox"]'
111  );
112
113  // Add missing attributes
114  targetLink.attr("target", "_blank");
115  targetLink.attr("data-hotdoc-widget", "lightbox");
116
117  // Create and append the HotDoc script tag
118  var hotdocScript = $("<script>", {
119    async: true,
120    src: "https://cdn.hotdoc.com.au/static/assets/js/hotdoc-widgets.min.js",
121    charset: "utf-8",
122  });
123
124  targetLink.after(hotdocScript);
125});
126
127jQuery(document).ready(function ($) {
128  // SVG code
129  var svgCode =
130    '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="10" viewBox="0 0 15 10" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.51822 5.59284L12.6009 0.623494L14.4951 2.51826L7.51822 9.49516L0.495117 2.39921L2.38935 0.504761L6.15581 4.27152L7.51822 5.59284Z" fill="white"/></svg>';
131  if ($(window).width() < 1200) {
132    // Add SVG to elements with .dropdown-toggle class
133    $(".dropdown-toggle").html(function (_, oldHtml) {
134      return svgCode + oldHtml;
135    });
136  }
137});
138
139// Toogle Dropdown in Mobile
140jQuery(document).ready(function ($) {
141  if ($(window).width() < 1200) {
142    $(".nav-link.dropdown-toggle").click(function () {
143      $(this).next().slideToggle();
144      $(this).toggleClass("open-menu");
145    });
146
147    $(".zl-sub-menu-title ").click(function () {
148      $(this).next().slideToggle();
149      $(this).toggleClass("open-menu");
150    });
151  }
152});
153
154jQuery(document).ready(function ($) {
155  // toggle menu
156  $(".navbar-toggler").click(function () {
157    $(".navbar-collapse").slideToggle();
158  });
159
160  // Dropdown mneu
161  if ($(window).width() > 1200) {
162    $(".navbar-nav").on("click", ".dropdown-toggle span", function () {
163      $(this).siblings(".dropdown-menu").toggleClass("show-menu");
164    });
165  }
166
167  // toggle search
168  var serachContainer = $("#searchButton");
169  var searchButton = $(".search-icon");
170  var overlay = $("<div class='search-overlay'></div>");
171  var closeSearch = $(".search-close");
172
173  function appendOverlay() {
174    $("body").append(overlay);
175  }
176
177  closeSearch.on("click", function () {
178   
179    overlay.remove();
180    serachContainer.removeClass("expand");
181    $(".nav-menubar-container").removeClass("relative");
182  });
183
184  // Example: Call appendOverlay() when the searchButton is clicked
185  searchButton.on("click", function () {
186    appendOverlay();
187    serachContainer.addClass("expand");
188    $(".nav-menubar-container").addClass("relative");
189  });
190
191  // Sliders
192  $(".treatment-slider").slick({
193    dots: false,
194    infinite: false,
195    speed: 500,
196    slidesToShow: 4,
197    slidesToScroll: 1,
198    responsive: [
199      {
200        breakpoint: 991,
201        settings: {
202          slidesToShow: 3,
203          slidesToScroll: 3,
204          infinite: true,
205        },
206      },
207      {
208        breakpoint: 768,
209        settings: {
210          slidesToShow: 2,
211          slidesToScroll: 2,
212        },
213      },
214      {
215        breakpoint: 576,
216        settings: {
217          slidesToShow: 1,
218          slidesToScroll: 1,
219        },
220      },
221    ],
222  });
223  $(".team-slider").slick({
224    dots: false,
225    infinite: false,
226    speed: 500,
227    slidesToShow: 3,
228    slidesToScroll: 1,
229    responsive: [
230      {
231        breakpoint: 768,
232        settings: {
233          slidesToShow: 2,
234          slidesToScroll: 2,
235          infinite: true,
236        },
237      },
238      {
239        breakpoint: 576,
240        settings: {
241          slidesToShow: 1,
242          slidesToScroll: 1,
243        },
244      },
245    ],
246  });
247  $(".data-single-img-slider").slick({
248    dots: false,
249    infinite: true,
250    speed: 500,
251    slidesToShow: 1,
252    slidesToScroll: 1,
253  });
254  // $(".brand-statement-slider").slick({
255  //   dots: true,
256  //   infinite: false,
257  //   arrows: false,
258  //   speed: 500,
259  //   slidesToShow: 1,
260  //   slidesToScroll: 1,
261  // });
262});
263
264// Custom Accordian JS
265jQuery(document).ready(function ($) {
266  var acc = document.getElementsByClassName("accordion");
267  var i;
268
269  for (i = 0; i < acc.length; i++) {
270    acc[i].addEventListener("click", function () {
271      // Close all accordions
272      for (var j = 0; j < acc.length; j++) {
273        if (acc[j] !== this) {
274          acc[j].classList.remove("active");
275          acc[j].nextElementSibling.style.maxHeight = null;
276        }
277      }
278      // Toggle the clicked accordion
279      this.classList.toggle("active");
280      var panel = this.nextElementSibling;
281      if (panel.style.maxHeight) {
282        panel.style.maxHeight = null;
283      } else {
284        panel.style.maxHeight = panel.scrollHeight + "px";
285      }
286    });
287  }
288
289  // Play Video
290  const videos = document.querySelectorAll(".zl-video");
291  const playButtons = document.querySelectorAll(".play-btn");
292
293  playButtons.forEach((playButton, index) => {
294    if (playButtons !== null) {
295      playButton.addEventListener("click", function () {
296        const video = videos[index];
297
298        if (video.paused) {
299          video.play();
300          video.controls = true;
301          playButton.style.display = "none";
302        } 
303        // else {
304        //   video.pause();
305        //   playButton.style.display = "block";
306        // }
307      });
308
309      // videos[index].addEventListener("ended", function () {
310      //   playButtons[index].style.display = "block";
311      // });
312    }
313  });
314
315  // Tabs
316  (function ($) {
317    $(".tabs-nav .tab-link").on("click", function () {
318      show_content($(this).index());
319    });
320
321    show_content(0);
322
323    function show_content(index) {
324      // Make the content visible
325      $(".tabs-content .content.visible").removeClass("visible");
326      $(".tabs-content .content:nth-of-type(" + (index + 1) + ")").addClass(
327        "visible"
328      );
329
330      // Set the tab to selected
331      $(".tabs-nav button.selected").removeClass("selected");
332      $(".tabs-nav button:nth-of-type(" + (index + 1) + ")").addClass(
333        "selected"
334      );
335    }
336  })(jQuery);
337});
338
339// Animation Delay
340jQuery(document).ready(function ($) {
341  $(".skin-cancer-check-section .col-md-4").each(function (index) {
342    $(this).attr("data-aos-delay", 100 * index);
343  });
344
345  $(".medical-pathway-right .col-6").each(function (index) {
346    $(this).attr("data-aos-delay", 100 * index);
347  });
348
349  $(".review-section .col-md-6").each(function (index) {
350    $(this).attr("data-aos-delay", 100 * index);
351  });
352
353  $(".counter-wrapper .counter").each(function (index) {
354    $(this).attr("data-aos-delay", 100 * index);
355  });
356
357  $(".faq-microneedling-section .col-lg-3").each(function (index) {
358    $(this).attr("data-aos-delay", 100 * index);
359  });
360
361  $(".insights-section .col-md-4").each(function (index) {
362    $(this).attr("data-aos-delay", 100 * index);
363  });
364
365  $(".half-slider .card").each(function (index) {
366    $(this).attr("data-aos-delay", 100 * index);
367  });
368});
369
370// Top Hedaer Bar
371jQuery(document).ready(function ($) {
372  function fadeLoop() {
373      var $elements = $('.zl-ribbon-list-text');
374      $elements.eq(0).fadeIn(4500, function () {
375          $(this).fadeOut(4500, function () {
376              $elements.slice(1).fadeIn(4500, function () {
377                  $(this).fadeOut(4500, function () {
378                      fadeLoop(); // Recursive call for infinite loop
379                  });
380              });
381          });
382      });
383  }
384  fadeLoop();
385});
386
387
388
389
390// Tooltip js
391

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.