PageSourceSearch

https://www.qab.co.jp/wp-content/plugins/sticky-header-effects-for-elementor/assets/js/she-header.js?ver=2.1.7

js qab.co.jp collected 2026-09-24 09:34:25 UTC 15,268 bytes, 379 lines download raw bytes

1var $j = jQuery.noConflict();
2
3$j(document).ready(function () {
4    "use strict";
5    // She header
6    sheHeader();
7
8    $j(window).on('resize', function (e) {
9        sheHeader(e);
10    });
11});
12
13
14/* ==============================================
15HEADER EFFECTS
16============================================== */
17
18
19function sheHeader(e) {
20   
21    var header = $j('.elementor-element.she-header-yes'),
22        container = $j('.she-header-yes .elementor-container, .elementor-element.she-header-yes.e-con'),
23        header_elementor = $j('.elementor-edit-mode .she-header-yes'),
24        header_logo = $j('.she-header-yes .elementor-widget-theme-site-logo img:not(.elementor-widget-n-menu img), .she-header-yes .elementor-widget-image img:not(.elementor-widget-n-menu img)'),
25        header_logo_div = $j('.she-header-yes .elementor-widget-theme-site-logo a::after, .she-header-yes .elementor-widget-image a::after');
26    data_settings = header.data('settings');
27
28    if (typeof data_settings != 'undefined') {
29        var responsive_settings = data_settings["transparent_on"];
30        var width = $j(window).width(),
31            header_height = header.height(),
32            logo_width = header_logo.width(),
33            logo_height = header_logo.height();
34    }
35
36    // Check responsive is enabled
37    if (typeof width != 'undefined' && width) {
38        if (width >= 1025) {
39            var enabled = "desktop";
40        } else if (width > 767 && width < 1025) {
41            var enabled = "tablet";
42        } else if (width <= 767) {
43            var enabled = "mobile";
44        }
45    }
46
47    if ($j.inArray(enabled, responsive_settings) != '-1') {
48
49        var scroll_distance = data_settings["scroll_distance"];
50        var she_offset = data_settings["she_offset_top"];
51        var she_padding = data_settings["she_padding"];
52        var she_width = data_settings["she_width"];
53        var transparent_header = data_settings["transparent_header_show"];
54        var background = data_settings["background"];
55        var bottom_border_color = data_settings["custom_bottom_border_color"],
56            bottom_border_view = data_settings["bottom_border"],
57            bottom_border_width = data_settings["custom_bottom_border_width"];
58
59        var shrink_header = data_settings["shrink_header"],
60            data_height = data_settings["custom_height_header"],
61            data_height_tablet = data_settings["custom_height_header_tablet"],
62            data_height_mobile = data_settings["custom_height_header_mobile"];
63
64        var shrink_logo = data_settings["shrink_header_logo"],
65            data_logo_height = data_settings["custom_height_header_logo"],
66            data_logo_height_tablet = data_settings["custom_height_header_logo_tablet"],
67            data_logo_height_mobile = data_settings["custom_height_header_logo_mobile"];
68
69        var change_logo_color = data_settings["change_logo_color"];
70
71        var blur_bg = data_settings["blur_bg"];
72
73        var scroll_distance_hide_header = data_settings["scroll_distance_hide_header"];
74
75        // offset
76        if (width >= 1025) {
77            she_offset = data_settings["she_offset_top"];
78            she_padding = data_settings["she_padding"];
79            she_width = data_settings["she_width"];
80        } else if (width > 767 && width < 1025) {
81            she_offset = data_settings["she_offset_top_tablet"];
82            she_padding = data_settings["she_padding_tablet"];
83            she_width = data_settings["she_width_tablet"];
84        } else if (width <= 767) {
85            she_offset = data_settings["she_offset_top_mobile"];
86            she_padding = data_settings["she_padding_mobile"];
87            she_width = data_settings["she_width_mobile"];
88        }
89
90        if (header.hasClass("she-header")) {
91            if( e?.type === 'resize' ){
92                header.css("width", she_width.size + she_width.unit);
93                header.css("padding-top", she_padding.top + she_padding.unit);
94                header.css("padding-bottom", she_padding.bottom + she_padding.unit);
95                header.css("padding-left", she_padding.left + she_padding.unit);
96                header.css("padding-right", she_padding.right + she_padding.unit);
97            }
98        }
99
100        // add transparent class
101        if (transparent_header == "yes") {
102            header.addClass('she-header-transparent-yes');
103        }
104
105        // header height shrink
106        if (typeof data_height != "undefined" && data_height) {
107            if (width >= 1025) {
108                var shrink_height = data_height["size"];
109            } else if (width > 767 && width < 1025) {
110                var shrink_height = data_height_tablet["size"];
111                if (shrink_height == "") {
112                    shrink_height = data_height["size"];
113                }
114            } else if (width <= 767) {
115                var shrink_height = data_height_mobile["size"];
116                if (shrink_height == "") {
117                    shrink_height = data_height["size"];
118                }
119            }
120        }
121
122        // Logo height shrink
123        if (
124            typeof data_logo_height != "undefined" &&
125            data_logo_height
126        ) {
127            if (width >= 1025) {
128                var shrink_logo_height = data_logo_height["size"];
129            } else if (width > 767 && width < 1025) {
130                var shrink_logo_height =
131                    data_logo_height_tablet["size"];
132            } else if (width <= 767) {
133                var shrink_logo_height =
134                    data_logo_height_mobile["size"];
135            }
136
137            //Calc New width and height
138            if (shrink_logo_height == "") {
139                //Get logo shrink settings from desktop
140                shrink_logo_height = data_logo_height["size"];
141
142                if (shrink_logo_height == "") {
143                    // Shrink same settings from height shrink option
144                    shrink_logo_height = shrink_height;
145
146                    var percent =
147                        parseInt(shrink_logo_height) /
148                        parseInt(header_height),
149                        width_l = logo_width * percent,
150                        height_l = logo_height * percent;
151                } else {
152                    var width_l =
153                        (logo_width * shrink_logo_height) / 100,
154                        height_l =
155                            (logo_height * shrink_logo_height) / 100;
156                }
157            } else {
158                //Get logo shrink settings from the responsive option
159                var width_l = (logo_width * shrink_logo_height) / 100,
160                    height_l = (logo_height * shrink_logo_height) / 100;
161            }
162        }
163
164        // border bottom
165        if (typeof bottom_border_width != 'undefined' && bottom_border_width) {
166            var bottom_border = bottom_border_width["size"] + "px solid " + bottom_border_color;
167        }
168
169        // hide header on scroll
170        if (
171            typeof scroll_distance_hide_header != "undefined" &&
172            scroll_distance_hide_header
173        ) {
174            var mywindow = $j(window),
175                mypos = mywindow.scrollTop();
176
177            mywindow.scroll(function () {
178                var sd_hh_s = scroll_distance_hide_header["size"],
179                    sd_hh_u = scroll_distance_hide_header["unit"],
180                    sd_hh_tablet =
181                        data_settings[
182                        "scroll_distance_hide_header_tablet"
183                        ],
184                    sd_hh_tablet_s = sd_hh_tablet["size"],
185                    sd_hh_tablet_u = sd_hh_tablet["unit"],
186                    sd_hh_mobile =
187                        data_settings[
188                        "scroll_distance_hide_header_mobile"
189                        ],
190                    sd_hh_mobile_s = sd_hh_mobile["size"],
191                    sd_hh_mobile_u = sd_hh_mobile["unit"];
192
193                // get responsive view
194                if (
195                    typeof scroll_distance_hide_header != "undefined" &&
196                    scroll_distance_hide_header
197                ) {
198                    if (width >= 1025) {
199                        var sd_hh = sd_hh_s,
200                            sd_hh_u = sd_hh_u;
201                        // calc sise for vh unit
202                        if (sd_hh_u == "vh") {
203                            sd_hh = window.innerHeight * (sd_hh / 100);
204                        }
205                    } else if (width > 767 && width < 1025) {
206                        var sd_hh = sd_hh_tablet_s,
207                            sd_hh_u = sd_hh_tablet_u;
208
209                        if (sd_hh == "") {
210                            sd_hh = sd_hh_s;
211                        }
212                        // calc sise for vh unit
213                        if (sd_hh_u == "vh") {
214                            sd_hh = window.innerHeight * (sd_hh / 100);
215                        }
216                    } else if (width <= 767) {
217                        var sd_hh = sd_hh_mobile_s,
218                            sd_hh_u = sd_hh_mobile_u;
219
220                        if (sd_hh == "") {
221                            sd_hh = sd_hh_s;
222                        }
223                        // calc sise for vh unit
224                        if (sd_hh_u == "vh") {
225                            sd_hh = window.innerHeight * (sd_hh / 100);
226                        }
227                    }
228                }
229
230                // added option for vh unit
231                //if(sd_hh_u == 'px'){
232                //	sd_hh  = sd_hh_s;
233                //} else {
234                //	sd_hh  = (window.innerHeight)*(sd_hh_s/100);
235                //}
236
237                if (mypos > sd_hh) {
238                    if (mywindow.scrollTop() > mypos) {
239                        header.addClass("headerup");
240                    } else {
241                        header.removeClass("headerup");
242                    }
243                }
244                mypos = mywindow.scrollTop();
245            });
246        }
247
248        // scroll function
249        $j(window).on("load scroll", function (e) {
250            var scroll = $j(window).scrollTop();
251
252            if (header_elementor) {
253                header_elementor.css("position", "relative");
254            }
255
256            var sd_s = scroll_distance["size"],
257                sd_u = scroll_distance["unit"],
258                sd_tablet = data_settings["scroll_distance_tablet"],
259                sd_tablet_s = sd_tablet["size"],
260                sd_tablet_u = sd_tablet["unit"],
261                sd_mobile = data_settings["scroll_distance_mobile"],
262                sd_mobile_s = sd_mobile["size"],
263                sd_mobile_u = sd_mobile["unit"];
264
265            // get responsive view
266            if (
267                typeof scroll_distance != "undefined" &&
268                scroll_distance
269            ) {
270                if (width >= 1025) {
271                    var sd = sd_s,
272                        sd_u = sd_u;
273                    // calc sise for vh unit
274                    if (sd_u == "vh") {
275                        sd = window.innerHeight * (sd / 100);
276                    }
277                } else if (width > 767 && width < 1025) {
278                    var sd = sd_tablet_s,
279                        sd_u = sd_tablet_u;
280
281                    if (sd == "") {
282                        sd = sd_s;
283                    }
284                    // calc sise for vh unit
285                    if (sd_u == "vh") {
286                        sd = window.innerHeight * (sd / 100);
287                    }
288                } else if (width <= 767) {
289                    var sd = sd_mobile_s,
290                        sd_u = sd_mobile_u;
291
292                    if (sd == "") {
293                        sd = sd_s;
294                    }
295                    // calc sise for vh unit
296                    if (sd_u == "vh") {
297                        sd = window.innerHeight * (sd / 100);
298                    }
299                }
300            }
301
302            if (scroll >= scroll_distance["size"]) {
303                header.removeClass('header').addClass("she-header");
304                header.css("background-color", background);
305                header.css("border-bottom", bottom_border);
306
307                header.css("top", she_offset.size + she_offset.unit);
308
309                if (width >= 768) {
310                    if (document.body.classList.contains('admin-bar')) {
311                        header.css("top", (32 + she_offset.size) + she_offset.unit);
312                    }
313                }
314
315                header.css("padding-top", she_padding.top + she_padding.unit);
316                header.css("padding-bottom", she_padding.bottom + she_padding.unit);
317                header.css("padding-left", she_padding.left + she_padding.unit);
318                header.css("padding-right", she_padding.right + she_padding.unit);
319                header.css("width", she_width.size + she_width.unit);
320                // header.attr("style", "width: " + she_width.size + she_width.unit + " !important;");
321                // header.css("width", she_width.size + she_width.unit);
322
323                header.removeClass('she-header-transparent-yes');
324
325                if (shrink_header == "yes") {
326                    header.css({ "padding-top": "0", "padding-bottom": "0", "margin-top": "0", "margin-bottom": "0" });
327                    container.css({ "min-height": shrink_height, "transition": "all 0.4s ease-in-out", "
327-webkit-transition": "all 0.4s ease-in-out", "-moz-transition": "all 0.4s ease-in-out" });
328                }
329
330                if (change_logo_color == "yes") {
331                    header_logo.addClass("change-logo-color");
332                }
333
334                // ---------------------------------- SHRINK LOGO
335                if (shrink_logo == "yes") {
336                    header_logo.css({
337                        width: width_l,
338                        transition: "all 0.4s ease-in-out",
339                        "-webkit-transition": "all 0.4s ease-in-out",
340                        "-moz-transition": "all 0.4s ease-in-out",
341                    });
342                }
343
344            } else {
345                header.removeClass("she-header").addClass('header');
346                header.css("background-color", "");
347                header.css("border-bottom", "");
348                header.css("top", "");
349                header.css("padding-top", "");
350                header.css("padding-bottom", "");
351                header.css("padding-left", "");
352                header.css("padding-right", "");
353                header.css("width", "");
354
355                if (transparent_header == "yes") {
356                    header.addClass('she-header-transparent-yes');
357                }
358                if (shrink_header == "yes") {
359                    header.css({ "padding-top": "", "padding-bottom": "", "margin-top": "", "margin-bottom": "" });
360                    container.css("min-height", "");
361                }
362
363                // ---------------------------------- SHRINK LOGO
364                if (shrink_logo == "yes") {
365                    header_logo.css({ height: "", width: "" });
366                }
367
368                if (change_logo_color == "yes") {
369                    header_logo.removeClass("change-logo-color");
370
371                }
372
373            }
374
375
376        });
377    }
378
379};

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.