PageSourceSearch

https://clickz.com/wp-content/themes/clickz/js/main.js?ver=2020021000

js clickz.com collected 2026-09-24 06:57:58 UTC 7,250 bytes, 243 lines download raw bytes

1var windowLoaded = false;
2$(document).ready(function () {
3
4    if (typeof LazyLoad !== 'undefined') {
5        var lazyLoadInstance = new LazyLoad({
6            elements_selector: ".lazy"
7        });
8    }
9
10    /**
11     * Flip card click handling
12     * The 3D flip animation breaks native link clicks, so we handle
13     * navigation via JS. Also adds touch support (tap to flip, tap
14     * again to navigate) and visual click feedback.
15     */
16    (function() {
17        var flippedCard = null;
18
19        // On touch devices, first tap flips the card, second tap navigates
20        // On desktop, hover flips and click navigates immediately
21        var isTouch = 'ontouchstart' in window;
22
23        $('.flip-card').on('click', function(e) {
24            // Don't intercept clicks on actual buttons/links inside the back
25            if ($(e.target).closest('.btn, a:not(.ab__link)').length) {
26                return;
27            }
28
29            var $card = $(this);
30            var href = $card.find('.ab__link').first().attr('href');
31            if (!href) return;
32
33            if (isTouch) {
34                // Touch: first tap flips, second tap navigates
35                if ($card.hasClass('flip-card--touched')) {
36                    // Second tap — navigate
37                    $card.addClass('flip-card--clicked');
38                    window.location.href = href;
39                } else {
40                    // First tap — flip the card
41                    e.preventDefault();
42                    if (flippedCard && flippedCard[0] !== $card[0]) {
43                        flippedCard.removeClass('flip-card--touched');
44                    }
45                    $card.addClass('flip-card--touched');
46                    flippedCard = $card;
47                }
48            } else {
49                // Desktop: click navigates immediately
50                $card.addClass('flip-card--clicked');
51                window.location.href = href;
52            }
53        });
54
55        // Dismiss flipped card when tapping elsewhere on touch
56        if (isTouch) {
57            $(document).on('click', function(e) {
58                if (flippedCard && !$(e.target).closest('.flip-card').length) {
59                    flippedCard.removeClass('flip-card--touched');
60                    flippedCard = null;
61                }
62            });
63        }
64    })();
65
66    // $('#gated-modal').modal('show');
67    // $('.cnt-cg-btn').click( function(e) {
68    //     $('.collapse').collapse('hide');
69    // });
70
71
72    function fixed_on_scroll() {
73
74        if ($('.ranking-accordion').length) {
75
76            var block = $('.ranking-accordion').offset().top - 50;
77
78            if ($(window).scrollTop() > block)
79                $('.ranking-panel__header-container').addClass('ranking-panel__header-container--fixed');
80            else
81                $('.ranking-panel__header-container').removeClass('ranking-panel__header-container--fixed');
82
83        }
84
85        if ($('.ad__canvas-payload').length) {
86
87
88            var canvas = $('.ad__canvas-payload'),
89                canvasAdPosition = 240;
90
91            if ($(window).scrollTop() > canvasAdPosition) {
92                $(canvas).addClass('ad__canvas--scroll');
93            } else {
94                $(canvas).removeClass('ad__canvas--scroll');
95            }
96
97        }
98
99    }
100
101    /**
102     * Bootstrap collapse code
103     */
104    $(window).scroll(function () {
105
106        fixed_on_scroll();
107
108        // shrink the nav once it hits below 80px
109        var navHeight = 80;
110        var scroll = $(window).scrollTop();
111        if (scroll >= navHeight) {
112            $('body').addClass('nav__shrunk');
113            $(".nav").addClass("nav__shrink");
114        } else {
115            $('body').removeClass('nav__shrunk');
116            $(".nav").removeClass("nav__shrink");
117        }
118    });
119
120    /**
121     * Cookie bar
122     */
123    $.cookieBar({
124        message: 'This site uses cookies to improve your user experience. <a target="_blank" href="https://www.clickz.com/privacy-policy/">Read More</a>',
125        acceptText: 'Accept',
126        fixed: true,
127    });
128
129    /**
130    * Signup bar
131    */
132
133    if ($.signupBar) {
134        $.signupBar({
135            message: '',
136            acceptText: 'Sign up to our Newsletter',
137            declineButton: false,
138            fixed: true,
139            bottom: true
140        });
141    }
142    /**
143     * Toggle for search button
144     */
145    $('.nav__icons-menu-search a').on('click', function (e) {
146        $(".nav__search").toggle();
147        e.preventDefault();
148    });
149
150    /**
151     * Overlay menu
152     */
153    $('.nav__icons-menu-menu').on('click', function (e) {
154        $(".menu__overlay").addClass('menu__overlay--open');
155        $('body').addClass('menu__overlay--body');
156        e.preventDefault();
157    });
158
159    // close overlay menu
160    $('.mo__close-btn').on('click', function (e) {
161        $(".menu__overlay").removeClass('menu__overlay--open');
162        $('body').removeClass('menu__overlay--body');
163        e.preventDefault();
164    });
165
166    $('.mo__nav-expand').on('click', function () {
167        var target = $(this).data('target');
168        $(this).toggleClass('open');
169        $(target).toggle();
170    });
171
172
173    /**
174     * Bootstrap dropdown click
175     * Prevent from clipping if it ends
176     * outside the browser window
177     */
178
179    $('.dropdown-toggle').click(function () {
180        var dropdownList = $('.dropdown-menu');
181        var dropdownOffset = $(this).offset();
182        var offsetLeft = dropdownOffset.left;
183        var dropdownWidth = dropdownList.width();
184        var docWidth = $(window).width();
185
186        var subDropdown = $('.dropdown-menu').eq(1);
187        var subDropdownWidth = subDropdown.width();
188
189        var isDropdownVisible = (offsetLeft + dropdownWidth <= docWidth);
190        var isSubDropdownVisible = (offsetLeft + dropdownWidth + subDropdownWidth <= docWidth);
191
192        if (!isDropdownVisible || !isSubDropdownVisible) {
193            $('.dropdown-menu').addClass('dropdown-menu__clip');
194        } else {
195            $('.dropdown-menu').removeClass('dropdown-menu__clip');
196        }
197    });
198
199
200    /**
201     * Close search box with click outside container
202     */
203    $(document).click(function (event) {
204        if (!$(event.target).closest('.nav__icons-menu-search').length) {
205            if ($('.nav__search').is(":visible")) {
206                $('.nav__search').hide();
207            }
208        }
209    });
210
211    if (window.location.hash == '#newsletter-modal') {
212        newsletter_modal();
213    }
214
215    $('a').on('click', function () {
216        if ($(this).attr('href') == '#newsletter-modal') {
217            newsletter_modal();
218        }
219    });
220
221    // GDPR Function
222    // Show vendors to the reader based on the marketo form data
223    if ($('.gdrpr__form').length) {
224        $.each($("input[name*='gDPROptin']:checked"), function () {
225            $(this).closest('.mktoFormRow').show();
226        });
227
228        $('body').on('marketoFormRendered', function () {
229            $.each($(".gdrpr__form input[name*='gDPROptin']:checked"), function () {
230                $(this).closest('.mktoFormRow').show();
231            });
232        })
233    }
234
235});
236
237$(window).on('load', function () {
238    windowLoaded = true;
239
240    if ($('#timer-modal') != null) {
241        $('#timer-modal').modal('show');
242    }
243});

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.