PageSourceSearch

https://webcie.ca/wp-content/themes/stockholm-child-final/js/custom.js?ver=1.0

js webcie.ca collected 2026-10-08 05:35:48 UTC 3,658 bytes, 116 lines download raw bytes

1jQuery(document).ready(function( $ ) {
2    
3    // Procédure permettant de fixer le menu pour qu'il soit interactif et fullscreen
4	//$(".mobile_menu_button span").removeEvent();
5	$(".mobile_menu_button").on("click", function(){
6	   // setTimeout(3000, function(){
7	   //     $("body").stopPropagation();
8    //         $("body").preventDefault();
9	   // })
10	    
11	    if($("header").hasClass("openmobilemenu")){
12	            // Le header n'est pas anime
13	            $("header").animate({
14                    height: "101px"
15                    }, 500, function() {
16                        $("header").removeClass("openmobilemenu");
17                        $(".mobile_menu_button").css( 'pointer-events', 'default' );
18                    });
19	        
20	        
21	    } else{
22	        $("header").animate({
23            height: "100%"
24            }, 500, function() {
25                $("header").addClass("openmobilemenu");
26            });
27	    }
28	})
29	
30});
31
32function setEqualHeights() {
33  const items = document.querySelectorAll('.qode-iwoi-info-holder.qode-appear');
34  const count = items.length;
35 
36  if (!count) return false;
37 
38  if (window.innerWidth <= 767) {
39    items.forEach(el => (el.style.height = "auto"));
40    return true;
41  }
42 
43  let maxHeight = 0;
44  items.forEach(el => {
45    el.style.height = "auto"; // reset first
46    maxHeight = Math.max(maxHeight, el.offsetHeight);
47  });
48 
49  items.forEach(el => {
50    el.style.height = maxHeight + "px";
51  });
52 
53  return true;
54}
55 
56// total number of holders
57const expectedCount = document.querySelectorAll('.qode-iwoi-info-holder').length;
58let lastCount = 0;
59let finalRun = false;
60 
61let checkInterval = setInterval(() => {
62  const appearCount = document.querySelectorAll('.qode-iwoi-info-holder.qode-appear').length;
63 
64  // new appear detected
65  if (appearCount > lastCount) {
66    lastCount = appearCount;
67 
68    // schedule a run (debounced via timeout)
69    setTimeout(setEqualHeights, 200);
70  }
71 
72  // when all are visible
73  if (appearCount === expectedCount && expectedCount > 0) {
74    if (finalRun) {
75      clearInterval(checkInterval); // stop after the extra run
76      console.log("Final run completed. Interval stopped.");
77    } else {
78      setEqualHeights(); // run immediately once
79      finalRun = true;   // mark for next tick to be last
80    }
81  }
82}, 500);
83 
84// also re-run on resize + scroll
85let resizeTimeout, scrollTimeout;
86window.addEventListener("resize", () => {
87  clearTimeout(resizeTimeout);
88  resizeTimeout = setTimeout(setEqualHeights, 200);
89});
90 
91
92// Faster scroll for the "See our work / Voir nos sites" banner button only
93document.addEventListener('click', function (e) {
94    var btn = e.target.closest('.packages-cta-btn');
95    if (!btn) return;
96
97    var hash = btn.getAttribute('href'); // "#forfaits" or "#packages"
98    if (!hash || hash.charAt(0) !== '#') return;
99
100    // This theme scrolls to WPBakery rows via a data-q_id="#forfaits" attribute,
101    // not a plain id="forfaits" — so we target it the same way the theme does.
102    var $target = jQuery('[data-q_id="' + hash + '"]');
103    if (!$target.length) {
104        $target = jQuery(hash); // fallback if it's ever a normal id anchor
105    }
106    if (!$target.length) return;
107
108    e.preventDefault();
109    e.stopPropagation();        // stop the theme's own 1500ms handler from also firing
110    e.stopImmediatePropagation();
111
112    jQuery('html, body').stop().animate({
113        scrollTop: $target.offset().top - 100 // adjust 100 if header overlap looks off
114    }, 250); // <-- speed in ms. Theme default is 1500; tune 300-500 to taste
115}, true); // capture phase — runs before the theme's bubble-phase handler, so it always wins
116

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.