PageSourceSearch

https://tgiw.info/wp-content/themes/elegantwp/assets/js/custom.js

js tgiw.info collected 2026-10-02 06:41:59 UTC 5,042 bytes, 123 lines download raw bytes

1jQuery(document).ready(function($) {
2
3    $(".elegantwp-nav-secondary .elegantwp-secondary-nav-menu").addClass("elegantwp-secondary-responsive-menu");
4
5    $( ".elegantwp-secondary-responsive-menu-icon" ).on( "click", function() {
6        $(this).next(".elegantwp-nav-secondary .elegantwp-secondary-nav-menu").slideToggle();
7    });
8
9    $(window).on( "resize", function() {
10        if(window.innerWidth > 1112) {
11            $(".elegantwp-nav-secondary .elegantwp-secondary-nav-menu, nav .sub-menu, nav .children").removeAttr("style");
12            $(".elegantwp-secondary-responsive-menu > li").removeClass("elegantwp-secondary-menu-open");
13        }
14    });
15
16    $( ".elegantwp-secondary-responsive-menu > li" ).on( "click", function(event) {
17        if (event.target !== this)
18        return;
19        $(this).find(".sub-menu:first").toggleClass('elegantwp-submenu-toggle').parent().toggleClass("elegantwp-secondary-menu-open");
20        $(this).find(".children:first").toggleClass('elegantwp-submenu-toggle').parent().toggleClass("elegantwp-secondary-menu-open");
21    });
22
23    $( "div.elegantwp-secondary-responsive-menu > ul > li" ).on( "click", function(event) {
24        if (event.target !== this)
25            return;
26        $(this).find("ul:first").toggleClass('elegantwp-submenu-toggle').parent().toggleClass("elegantwp-secondary-menu-open");
27    });
28
29    if(elegantwp_ajax_object.sticky_menu){
30    // grab the initial top offset of the navigation 
31    var elegantwpstickyNavTop = $('.elegantwp-primary-menu-container').offset().top;
32    
33    // our function that decides weather the navigation bar should have "fixed" css position or not.
34    var elegantwpstickyNav = function(){
35        var elegantwpscrollTop = $(window).scrollTop(); // our current vertical position from the top
36             
37        // if we've scrolled more than the navigation, change its position to fixed to stick to top,
38        // otherwise change it back to relative
39
40        if(window.innerWidth > 1112) {
41            if (elegantwpscrollTop > elegantwpstickyNavTop) {
42                $('.elegantwp-primary-menu-container').addClass('elegantwp-fixed');
43            } else {
44                $('.elegantwp-primary-menu-container').removeClass('elegantwp-fixed'); 
45            }
46        }
47    };
48
49    elegantwpstickyNav();
50    // and run it again every time you scroll
51    $(window).on( "scroll", function() {
52        elegantwpstickyNav();
53    });
54    }
55
56    $(".elegantwp-nav-primary .elegantwp-primary-nav-menu").addClass("elegantwp-primary-responsive-menu");
57
58    $( ".elegantwp-primary-responsive-menu-icon" ).on( "click", function() {
59        $(this).next(".elegantwp-nav-primary .elegantwp-primary-nav-menu").slideToggle();
60    });
61
62    $(window).on( "resize", function() {
63        if(window.innerWidth > 1112) {
64            $(".elegantwp-nav-primary .elegantwp-primary-nav-menu, nav .sub-menu, nav .children").removeAttr("style");
65            $(".elegantwp-primary-responsive-menu > li").removeClass("elegantwp-primary-menu-open");
66        }
67    });
68
69    $( ".elegantwp-primary-responsive-menu > li" ).on( "click", function(event) {
70        if (event.target !== this)
71        return;
72        $(this).find(".sub-menu:first").toggleClass('elegantwp-submenu-toggle').parent().toggleClass("elegantwp-primary-menu-open");
73        $(this).find(".children:first").toggleClass('elegantwp-submenu-toggle').parent().toggleClass("elegantwp-primary-menu-open");
74    });
75
76    $( "div.elegantwp-primary-responsive-menu > ul > li" ).on( "click", function(event) {
77        if (event.target !== this)
78            return;
79        $(this).find("ul:first").toggleClass('elegantwp-submenu-toggle').parent().toggleClass("elegantwp-primary-menu-open");
80    });
81
82    $(".elegantwp-social-search-icon").on('click', function (e) {
83        e.preventDefault();
84        $('.elegantwp-social-search-box').slideToggle(400);
85    });
86
87    $(".post").fitVids();
88
89    var scrollButtonEl = $( '.elegantwp-scroll-top' );
90    scrollButtonEl.hide();
91
92    $(window).on( "scroll", function() {
93        if ( $( window ).scrollTop() < 20 ) {
94            $( '.elegantwp-scroll-top' ).fadeOut();
95        } else {
96            $( '.elegantwp-scroll-top' ).fadeIn();
97        }
98    } );
99
100    scrollButtonEl.on( "click", function() {
101        $( "html, body" ).animate( { scrollTop: 0 }, 300 );
102        return false;
103    } );
104
105    if(elegantwp_ajax_object.sticky_sidebar){
106    $('.elegantwp-main-wrapper, .elegantwp-sidebar-one-wrapper, .elegantwp-sidebar-two-wrapper').theiaStickySidebar({
107        containerSelector: ".elegantwp-content-wrapper",
108        additionalMarginTop: 0,
109        additionalMarginBottom: 0,
110        minWidth: 890,
111    });
112
113    $(window).on( "resize", function() {
114        $('.elegantwp-main-wrapper, .elegantwp-sidebar-one-wrapper, .elegantwp-sidebar-two-wrapper').theiaStickySidebar({
115            containerSelector: ".elegantwp-content-wrapper",
116            additionalMarginTop: 0,
117            additionalMarginBottom: 0,
118            minWidth: 890,
119        });
120    });
121    }
122
123});

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.