PageSourceSearch

https://pathao.com/wp-content/themes/webpathao/assets/js/custom.js?ver=2.0.12

js pathao.com collected 2026-09-24 08:52:22 UTC 8,561 bytes, 239 lines download raw bytes

1(function($) {
2    "use strict";    
3    //get content on viewport
4    $.fn.isInViewport = function() {
5        var elementTop = $(this).offset().top;
6        var elementBottom = elementTop + $(this).outerHeight();
7
8        var viewportTop = $(window).scrollTop();
9        var viewportBottom = viewportTop + $(window).height();
10
11        return elementBottom > viewportTop && elementTop < viewportBottom;
12    };
13    // get browser width
14    var $iW = jQuery(window).innerWidth();
15    
16    // search bar animation ===========================================
17    $( ".btn-search" ).on('click', function () {
18      $(".search-form").addClass('expand-form');
19      $(".search-field").focus();
20    });
21    
22    
23    //open dropdown menu    
24    if ($iW >= 991){
25        $('ul.topmenu li.dropdown').hover(function() {
26            $(this).find('.dropdown-menu').stop(true, true).delay(100).slideDown(200);
27        }, function() {
28            $(this).find('.dropdown-menu').stop(true, true).delay(100).slideUp(200);
29        });
30    }
31    if ($iW <= 767){
32        $('.footer-item').each(function () {
33            $(this).find('.widget-title').on('click', function () {
34                $(this).toggleClass("slidedown slideup");
35                $(this).next('.widget-container').slideToggle( "slow", function() {                    
36                });
37            });
38        });
39       
40    }
41
42    //timeline slider 
43    var timeline_slider = new Swiper('.timeline .swiper-container', {
44        loop: true,
45        speed: 600,
46        autoplay: {
47            delay: 5000
48        },        
49        pagination: {
50            el: '.swiper-pagination',            
51            clickable: true,
52            renderBullet: function (index, className) {
53              var year = document.querySelectorAll('.swiper-slide')[index].getAttribute('data-year');
54              return '<li class="' + className + '"><span class="bullet"></span><span class="year-name">' + year + '</span></li>';
55            }
56        },
57        navigation: {
58          nextEl: '.swiper-button-next',
59          prevEl: '.swiper-button-prev'
60        } 
61    });
62    $(".timeline .swiper-container").mouseenter(function() {
63        timeline_slider.autoplay.stop();
64    });
65
66    $(".timeline .swiper-container").mouseleave(function() {
67        timeline_slider.autoplay.start();
68    });
69    
70    $(window).on('resize scroll', function () {
71        $('.timeline .swiper-container').each(function () {
72            if ($(this).isInViewport()) {
73                timeline_slider.autoplay.start();
74            } else {
75                timeline_slider.autoplay.stop();
76            }
77        });
78    });
79    
80    var pageCount = $('.timeline .swiper-pagination').data('page-number');
81    var ulWidth = $('.timeline .swiper-pagination').width();
82    $('.timeline .swiper-pagination .swiper-pagination-bullet').css('width',Math.floor(ulWidth/pageCount)); 
83    $('.timeline .swiper-pagination .swiper-pagination-bullet .year-name').css('width',Math.floor(ulWidth/pageCount)); 
84    //$('.timeline .swiper-slide-content .text-content').css('padding-left',Math.floor((ulWidth/pageCount)-26)); 
85    timeline_slider.on('slideChange', function () {
86        $( "li.swiper-pagination-bullet-active" ).prevAll().addClass('timeline-progress');
87        $( "li.swiper-pagination-bullet-active" ).nextAll().removeClass('timeline-progress');
88    });
89    
90    
91    //about pathao quote slider
92    var quoteslider = new Swiper('.management-quote .swiper-container', {
93        loop: true,
94        centeredSlides: true,
95        spaceBetween : 30,
96        autoHeight: true,
97        speed: 600,
98        autoplay: false,
99//        autoplay: {
100//            delay: 5000
101//        },
102        navigation: {
103          nextEl: '.swiper-button-next',
104          prevEl: '.swiper-button-prev'
105        }
106    });
107
108    // safe border wrapper
109    $(window).on('resize scroll', function () {
110        $('.safe-border-wrapper').each(function () {
111            if ($(this).isInViewport()) {
112                $(this).addClass('safe-border-wrapper-active');
113            } else {
114                $(this).removeClass('safe-border-wrapper-active');
115            }
116        });
117    });
118    
119
120    // testimonial slider ===========================================
121    var testimonial_swiper = new Swiper('.testimonial-slider', {
122      slidesPerView: 'auto',
123      spaceBetween: 0,
124      loop: true,
125      speed: 600,
126      autoplay: {
127        delay: 5000,
128        disableOnInteraction: true
129      },
130      navigation: {
131        nextEl: '.button-next',
132        prevEl: '.button-prev'
133      }
134    });
135    $(".testimonial-slider").mouseenter(function() {
136        testimonial_swiper.autoplay.stop();
137    });
138
139    $(".testimonial-slider").mouseleave(function() {
140        testimonial_swiper.autoplay.start();
141    });
142    
143    $(window).on('resize scroll', function () {
144        $('.testimonial-slider').each(function () {
145            if ($(this).isInViewport()) {
146                testimonial_swiper.autoplay.start();
147            } else {
148                testimonial_swiper.autoplay.stop();
149            }
150        });
151    });
152
153  // faq icon ===========================================
154  $('.faq-content .card-header .btn-link').on('click', function () {
155    $('.btn-link').children('.fa').removeClass('fa-minus');
156    $('.btn-link').children('.fa').addClass('fa-plus');
157    $(this).children('.fa').removeClass('fa-plus');
158    $(this).children('.fa').addClass('fa-minus');
159  });
160
161  // work step section ===========================================
162  $('.work-step-section .card-header .btn-link').on('click', function () {
163    $('.btn-link').children('.fa').removeClass('fa-chevron-down');
164    $('.btn-link').children('.fa').addClass('fa-chevron-right');
165    $(this).children('.fa').removeClass('fa-chevron-right');
166    $(this).children('.fa').addClass('fa-chevron-down');
167  });
168  
169  // footer menu ===========================================
170  if (window.matchMedia('(max-width: 767px)').matches) {
171//        $('.bg-black .footer-item h4').click(function(e) {
172//            $('.footer-menu').addClass('dn-x');
173//            $(e.target).next('.footer-menu').removeClass('dn-x')
174//        });
175        $(".go-top a").on('click', function () {
176            $("html, body").animate({
177                scrollTop: 0
178            }, "slow");
179            return !1
180        });
181    }
182
183    // sections animation =============================================
184    var wow = new WOW(
185    {
186	    boxClass:     'wow',      // default
187	    animateClass: 'animated', // default
188	    offset:       100,          // default
189	    mobile:       true,       // default
190	    live:         true        // default
191	  }
192    );
193    wow.init();
194
195    //form validation function
196    $.fn.regexMask = function(mask) {
197        $(this).keypress(function (event) {
198            if (!event.charCode) return true;
199            var part1 = this.value.substring(0, this.selectionStart);
200            var part2 = this.value.substring(this.selectionEnd, this.value.length);
201            if (!mask.test(part1 + String.fromCharCode(event.charCode) + part2))
202                return false;
203        });
204    };
205    
206    $(".allowchar").on("keypress keyup blur",function (event) {    
207        $(this).val($(this).val().replace(/[\d!`~!@#$%^&*()_=+"{}/,]+/, ""));         
208     });
209    $(".allownumeric").on("keypress keyup blur",function (event) {    
210        $(this).val($(this).val().replace(/[^\d].+/, ""));
211        if ((event.which < 48 || event.which > 57)) {
212            event.preventDefault();
213        }
214    });
215    $('.allowalphanumeric').on("keypress keyup blur",function (event) {
216        var regex = new RegExp("^[a-zA-Z0-9]+$");
217        if (!event.charCode) return true;
218        var part1 = this.value.substring(0, this.selectionStart);
219        var part2 = this.value.substring(this.selectionEnd, this.value.length);
220        if (!regex.test(part1 + String.fromCharCode(event.charCode) + part2))
221            return false;
222    });
223    $('.disablelink').on("keypress keyup blur",function (event) {
224        var urlexp = new RegExp( '(http|ftp|https)://[\\w-]+(\\.[\\w-]+)+([\\w-.,@?^=%&:/~+#-]*[\\w@?^=%&;/~+#-])?' );
225        if (!event.charCode) return true;
226        var part1 = this.value.substring(0, this.selectionStart);
227        var part2 = this.value.substring(this.selectionEnd, this.value.length);
228        if (!urlexp.test(part1 + String.fromCharCode(event.charCode) + part2))
229            return false;
230    });
231    
232    $('iframe#live-chat').load(function() {
233        $('.loader').hide();
234    });
235})(jQuery);
236
237
238
239     

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.