PageSourceSearch

https://www.indiacadworks.com/blog/wp-content/themes/icw_3.0/js/jquery_custom.js

js indiacadworks.com collected 2026-10-02 17:41:56 UTC 5,362 bytes, 149 lines download raw bytes

1jQuery(document).ready(function(){
2
3  $("ul li:nth-child(even)").addClass("even_item");
4  $("ul li:nth-child(odd)").addClass("odd_item");
5  $("ul li:last-child").addClass("last_item");
6  $("ul li:first-child").addClass("first_item");
7
8		jQuery('.show_hide_menu').click(function(){
9			jQuery('#menu').slideToggle('');
10			jQuery('.show_hide_menu').toggleClass('on');
11			jQuery('#menu .menu-sub').toggleClass('menu-sub');
12		});
13
14    var submitIcon = $('.searchbox-icon');
15    var inputBox = $('.searchbox-input');
16    var searchBox = $('.searchbox');
17    var isOpen = false;
18    submitIcon.click(function(){
19        if(isOpen == false){
20            searchBox.addClass('searchbox-open');
21            inputBox.focus();
22            isOpen = true;
23        } else {
24            searchBox.removeClass('searchbox-open');
25            inputBox.focusout();
26            isOpen = false;
27        }
28    });  
29      submitIcon.mouseup(function(){
30            return false;
31        });
32    searchBox.mouseup(function(){
33            return false;
34        });
35    $(document).mouseup(function(){
36            if(isOpen == true){
37                $('.searchbox-icon').css('display','block');
38                submitIcon.click();
39            }
40        });
41});
42
43jQuery(document).ready(function(){
44
45/* Custom Code For Pagination */
46
47if(jQuery('.search-results .paginate').find('.prev').length){
48  jQuery('.search-results .paginate').find('.prev').parent().addClass('prev_wrapper');
49}
50if(jQuery('.search-results .paginate').find('.next').length){
51  jQuery('.search-results .paginate').find('.next').parent().addClass('next_wrapper');
52}
53
54if(jQuery('.archive .paginate').find('.prev').length){
55  jQuery('.archive .paginate').find('.prev').parent().addClass('prev_wrapper');
56}
57if(jQuery('.archive .paginate').find('.next').length){
58  jQuery('.archive .paginate').find('.next').parent().addClass('next_wrapper');
59}
60
61var windowWidth = jQuery(window).width();
62
63if (windowWidth < 992) {
64  jQuery('.header-new .dropdown-toggle').on('click', function(e){
65      e.preventDefault();
66      jQuery(this).toggleClass('show');
67      jQuery(this).parent().find('> .dropdown-menu').toggleClass('show');
68  });
69   
70  jQuery('.header-service-menu .service-menu li.menu-item-has-children').append('<span></span>');
71}
72jQuery('span.search-icon').on('click', function(){
73  jQuery('form.searchbox-new').toggleClass('show_searchbox');
74});
75
76jQuery(".single-post .entry_post h2").each(function(index) {                                                     
77         var prevH2Item = null;                                                            
78        var prevH2List = null;
79        jQuery(this).attr('id','section_'+index);                                     
80        
81        var li = "<li><a href='#section_" + index + "'>" + jQuery(this).text() + "</a></li>"; 
82        
83        if( jQuery(this).is("h2") ){                                                    
84            prevH2Item = jQuery(li);                                     
85            prevH2Item.append(prevH2List);                          
86            prevH2Item.appendTo("#tocList");                        
87        } else {                                                    
88            prevH2List.append(li);                                  
89        }                                                           
90        index++;                                                    
91    });  
92});
93
94jQuery(document).ready(function($) {
95  if($('.single-post .toc-wrapper').length){
96    const tocWrapper = $('.toc-wrapper');
97    const footer = $('#footer'); 
98    const offset = tocWrapper.offset().top - 20;
99    const footerOffset = footer.offset().top; 
100
101    $(window).on('scroll', function() {
102        const scrollTop = $(window).scrollTop(); 
103        const tocHeight = tocWrapper.outerHeight(); 
104        const windowHeight = $(window).height(); 
105
106        if (scrollTop > offset && scrollTop + windowHeight < footerOffset) {
107            tocWrapper.addClass('fixed');
108        } else {
109            tocWrapper.removeClass('fixed');
110        }
111    });
112  }
113  jQuery('.mega_li_a i').on('click', function(e){
114    e.preventDefault();
115    e.stopPropagation();
116    jQuery(this).parents('.mega_li').find('.mega_sub_menu_div').toggleClass('show_sub_menu');
117    jQuery(this).parents('.mega_li').toggleClass('show_li_sub_menu');
118  });
119});
120
121document.addEventListener('DOMContentLoaded', function() {
122if($('.single-post #tocList').length){
123    const sections = document.querySelectorAll('.single-post .entry h2');
124    const menuItems = document.querySelectorAll('#tocList li');
125
126    function changeActiveClass() {
127        let index = sections.length;
128
129        while (--index && window.scrollY + 50 < sections[index].offsetTop) {}
130
131        menuItems.forEach((item) => item.classList.remove('active'));
132        menuItems[index].classList.add('active');
133    }
134
135    window.addEventListener('scroll', changeActiveClass);
136    changeActiveClass(); // Run on initial load
137  }
138});
139
140jQuery('button.navbar-toggler').on('click', function(){
141    jQuery(this).toggleClass('close-icon');
142    jQuery(this).parent().find('.navbar-collapse').toggleClass('show');
143    jQuery('.header-service-menu .service-menu').slideToggle();
144});
145jQuery('.header-service-menu .service-menu li.menu-item-has-children').on('click', function(){
146    jQuery(this).find('.sub-menu').slideToggle();
147});
148
149

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.