PageSourceSearch

https://naturalproducts.net/wp-content/themes/futurio/js/customscript.js?ver=1.5.7

js naturalproducts.net collected 2026-09-24 09:23:42 UTC 5,392 bytes, 165 lines download raw bytes

1jQuery.noConflict();
2(function ($) {
3    'use strict';
4
5    $(document).ready(function () {
6        $('body').addClass('loaded');
7    });
8
9    $('.navbar .dropdown-toggle').hover(function () {
10        $(this).addClass('disabled');
11    });
12
13    $(window).scroll(function () {
14        var $unstick = $('body.unstick-menu');
15        if (!$unstick.length) {
16            var $headerdiv = $('.site-header');
17            if ($headerdiv.length) {
18                var header = $('.site-header').outerHeight();
19            } else {
20                var header = 1;
21            }
22            if ($(document).scrollTop() > (header + 60)) {
23                $('nav#site-navigation').addClass('shrink');
24            } else {
25                $('nav#site-navigation').removeClass('shrink');
26            }
27        }
28    });
29
30    var $myDiv = $('#futurio-floating');
31    if ($myDiv.length) {
32        $(window).scroll(function () {
33            var distanceTop = $myDiv.prev().position().top + $myDiv.prev().height() + 80;
34
35            if ($(document).scrollTop() > distanceTop) {
36                $myDiv.addClass('floating-element');
37            } else {
38                $myDiv.removeClass('floating-element');
39            }
40        });
41    }
42
43    // Menu fixes
44    function MenuFix() {
45        $(function () {
46            if ($(window).width() > 767) {
47                $('.dropdown, .dropdown-submenu').hover(
48                        function () {
49                            $(this).addClass('open')
50                        },
51                        function () {
52                            $(this).removeClass('open')
53                        }
54                );
55                $('.dropdown, .dropdown-submenu').focusin(
56                        function () {
57                            $(this).addClass('open')
58                        }
59                );
60                $('.dropdown, .dropdown-submenu').focusout(
61                        function () {
62                            $(this).removeClass('open')
63                        }
64                );
65            } else {
66                $(".dropdown, .dropdown-submenu").hover(
67                        function () {
68                            $(this).removeClass('open')
69                        }
70                );
71            }
72        });
73    }
74    MenuFix();
75    $(window).on('resize', MenuFix);
76
77    // Mobile menu function
78    function FuturioMobileMenu() {
79        $('.open-panel').each(function () {
80            var menu = $(this).data('panel');
81            $("#" + menu).click(function (e) {
82                e.preventDefault();
83                $("body").toggleClass("openNav");
84                $("#" + menu + ".open-panel").toggleClass("open");
85            });
86            $("#site-navigation .menu-container a").click(function () {
87                $("body").toggleClass("openNav");
88                $("#" + menu + ".open-panel").toggleClass("open");
89            });
90
91        });
92    }
93    var $openPanel = $('.open-panel');
94    if ($openPanel.length) {
95        // Fire mobile menu
96        FuturioMobileMenu();
97
98    }
99
100    $('.top-search-icon .fa').click(function () {
101        $(".top-search-box").toggle('slow');
102        $(".top-search-icon .fa").toggleClass("fa-times fa-search");
103    });
104
105    $('.offcanvas-sidebar-toggle').on('click', function () {
106        $('body').toggleClass('offcanvas-sidebar-expanded');
107    });
108    $('.offcanvas-sidebar-close').on('click', function () {
109        $('body').toggleClass('offcanvas-sidebar-expanded');
110    });
111
112    var sections = $('section')
113            , nav = $('#site-navigation.navbar')
114            , nav_height = nav.outerHeight();
115
116    $(window).on('scroll', function () {
117        var cur_pos = $(this).scrollTop();
118
119        sections.each(function () {
120            var top = $(this).offset().top - nav_height - 30,
121                    bottom = top + $(this).outerHeight();
122
123            if (cur_pos >= top && cur_pos <= bottom) {
124                nav.find('a').parent().removeClass('active');
125                sections.removeClass('active');
126
127                $(this).addClass('active');
128                nav.find('a[href="#' + $(this).attr('id') + '"]').parent().addClass('active');
129            }
130        });
131    });
132
133    $(document).on('click', '.button.ajax_add_to_cart', function (e) {
134        //e.preventDefault();
135        $('body.open-head-cart').addClass('product-added-to-cart');
136    });
137    $(document).on('mouseover', '.product-added-to-cart ul.site-header-cart', function (e) {
138        e.preventDefault();
139        $('body.open-head-cart').removeClass('product-added-to-cart');
140    });
141    $(document).on('resize, ready', function() {
142        // Add class if screen size equals
143        var $window = $(window),
144        $html = $('body');
145
146        function resize() {
147           $html.removeClass('xs sm md lg');
148
149           if ($window.width() < 768) {
150             return $html.addClass('xs');
151           }
152           else if ($window.width() > 768 && $window.width() < 992) {
153             return $html.addClass('sm');
154           }
155           else if ($window.width() > 992 && $window.width() < 1200) {
156             return $html.addClass('md');
157           }
158           else if ($window.width() > 1200) {
159             return $html.addClass('lg');
160           }
161         }
162         $window.resize(resize).trigger('resize');
163         $window.load(resize).trigger('resize');
164   });
165})(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.