PageSourceSearch

https://kdcinfo.com/blog/wp-content/themes/palawan/candidthemes/assets/custom/js/custom.js?ver=1.3.7

js kdcinfo.com collected 2026-09-24 10:08:05 UTC 6,900 bytes, 200 lines download raw bytes

1jQuery(document).ready(function ($) {
2    if (jQuery('.top-header-toggle-btn').length > 0) {
3        $('.top-header-toggle-btn').on('click', function (e) {
4            e.preventDefault();
5            $('.site-header-topbar .container').toggle('slow');
6            $('.top-header-toggle-btn i').toggleClass('ct-rotate');
7        });
8    }
9    if ($('.hero_slick-slider').length > 0) {
10        $('.hero_slick-slider').slick({
11            items: 1,
12            dots: false,
13            infinite: true,
14            centerMode: false,
15            autoplay: true,
16            lazyLoad: 'ondemand',
17            adaptiveHeight: true
18        });
19    }
20
21    /*
22     ** ### Back to top function for guide section in detail page
23     */
24
25    if ($('.go-to-top').length) {
26        var scrollTrigger = $('body').position(); // px
27        goToTop = function () {
28
29            var scrollTop = $(window).scrollTop();
30            if (scrollTop > 150) {
31                $('.footer-go-to-top').addClass('show');
32            } else {
33                $('.footer-go-to-top').removeClass('show');
34            }
35        };
36        goToTop();
37        $(window).on('scroll', function () {
38            goToTop();
39        });
40        $('.go-to-top').on('click', function (e) {
41            e.preventDefault();
42            $('html,body').animate({
43                scrollTop: scrollTrigger.top
44            }, 700);
45        });
46    }
47
48
49
50
51    /****
52     * Mobile Dropdown Menu Script
53     */
54
55    var menuPrimary_ul = $('#primary-menu'),
56        parrentLink_li = $('#primary-menu > .menu-item-has-children'),
57        secondLink_li = $('#primary-menu > .menu-item-has-children .menu-item-has-children'),
58        subMenu_ul = $('#primary-menu > li  > .sub-menu'),
59        secSubMenu_ul = $('#primary-menu .sub-menu .sub-menu'),
60        MenuToggleBtn_button = $('#masthead .menu-toggle');
61
62    function addMobileAccessBtn() {
63        parrentLink_li.append('<span class="for-sub-menu"></span>');
64        secondLink_li.append('<span class="sec-sub-menu"></span>');
65    }
66
67    function mobileMenuEasyDropDown() {
68        addMobileAccessBtn();
69
70        var subMenuBtn_span = $('.for-sub-menu');
71        var secSubMenuBtn_span = $('.sec-sub-menu');
72
73        subMenuBtn_span.click(function () {
74            $(this).siblings(subMenu_ul).toggleClass('open');
75        })
76
77        secSubMenuBtn_span.click(function () {
78            $(this).siblings(secSubMenu_ul).toggleClass('sec-open');
79        })
80
81
82
83
84    }
85
86    function offCanvaMenu() {
87        jQuery('.main-navigation').addClass('toggled');
88        menuPrimary_ul.addClass('off_canva_nav');
89        $('#primary-menu > li:first-child').addClass('focus');
90        $('#primary-menu > li:first-child a').focus();
91
92
93    }
94
95    var width = $(window).width();
96    if (width < 992) {
97        $('.main-navigation').on('keydown', function (e) {
98            if ($('.main-navigation').hasClass('toggled')) {
99                var focusableEls = $('.main-navigation a[href]:not([disabled]), .main-navigation button');
100                var firstFocusableEl = focusableEls[0];
101                var lastFocusableEl = focusableEls[focusableEls.length - 1];
102                var KEYCODE_TAB = 9;
103                if (e.key === 'Tab' || e.keyCode === KEYCODE_TAB) {
104                    if (e.shiftKey) /* shift + tab */ {
105                        if (document.activeElement === firstFocusableEl) {
106                            lastFocusableEl.focus();
107                            e.preventDefault();
108                        }
109                    }
110                    else /* tab */ {
111                        if (document.activeElement === lastFocusableEl) {
112                            firstFocusableEl.focus();
113                            e.preventDefault();
114                        }
115                    }
116                }
117            }
118        });
119    }
120
121    MenuToggleBtn_button.click(function () {
122        offCanvaMenu();
123
124        jQuery('#primary-menu .close_nav').click(function () {
125
126            jQuery('.main-navigation').removeClass('toggled');
127            menuPrimary_ul.removeClass('off_canva_nav');
128            $('.menu-toggle').focus();
129        })
130    })
131
132    mobileMenuEasyDropDown();
133
134
135    /****
136     * Search Dialoge JS
137     */
138    if ($('.search-section').length) {
139        var searchDialoge_section = $('.site > .search-section'),
140            searchToggle_button = $('.search-toggle'),
141            searchField_input = $('.site > .search-section .search-field'),
142            searchClose_button = $('.close-btn');
143
144        searchToggle_button.click(function () {
145            searchDialoge_section.toggleClass('ct-search-access');
146            setTimeout(function () {
147                searchField_input.focus();
148            }, 100)
149
150            $('.site > .search-section').on('keydown', function (e) {
151                if ($('.site > .search-section').hasClass('ct-search-access')) {
152                    var focusableEls = $(' .site > .search-section .close-btn, .site > .search-section .search-field, .site > .search-section .search-submit');
153                    var firstFocusableEl = focusableEls[0];
154                    var lastFocusableEl = focusableEls[focusableEls.length - 1];
155                    var KEYCODE_TAB = 9;
156                    if (e.key === 'Tab' || e.keyCode === KEYCODE_TAB) {
157                        if (e.shiftKey) /* shift + tab */ {
158                            if (document.activeElement === firstFocusableEl) {
159                                lastFocusableEl.focus();
160                                e.preventDefault();
161                            }
162                        } else /* tab */ {
163                            if (document.activeElement === lastFocusableEl) {
164                                firstFocusableEl.focus();
165                                e.preventDefault();
166                            }
167                        }
168                    }
169                }
170            });
171
172            searchClose_button.click(function () {
173                searchDialoge_section.removeClass('ct-search-access');
174            });
175        });
176
177    }
178
179    //sticky sidebar
180    var at_body = $("body");
181    var at_window = $(window);
182
183    if (at_body.hasClass('ct-sticky-sidebar')) {
184        $('#secondary, #primary').theiaStickySidebar();
185
186    }
187
188});
189jQuery(window).load(function ($) {
190    if (jQuery('.palawan-masonry').length > 0) {
191        var $container = jQuery('.palawan-masonry');
192        // initialize
193        $container.masonry({
194            itemSelector: '.palawan-masonry article.post, .palawan-masonry article.page',
195            columnWidth: '.palawan-masonry article.post, .palawan-masonry article.page',
196            percentPosition: true
197        });
198    }
199});
200

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.