PageSourceSearch

https://simtinstitute.org/wp-content/themes/university/js/cactus-themes.js?ver=2.1

js simtinstitute.org collected 2026-09-26 07:57:32 UTC 19,087 bytes, 459 lines download raw bytes

1// JavaScript Document
2jQuery(document).ready(function(e) {
3    var check_rtl = false;
4    if (jQuery('body').hasClass('rtl')) {
5        check_rtl = true;
6    }
7
8    var woo_cart_update_buttons = function() {
9        jQuery('div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)').addClass('buttons_added').append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');
10        jQuery('.buttons_added #minus1').on('click', function(e) {
11            var inputquantity = jQuery('.input-text.qty', jQuery(this).parent());
12            var value = parseInt(inputquantity.val()) - 1;
13            if (value > 0) {
14                inputquantity.val(value);
15                jQuery('.woocommerce-cart table.cart input[name="update_cart"]').prop("disabled", false)
16            }
17        });
18        jQuery('.buttons_added #add1').on('click', function(e) {
19            var inputquantity = jQuery('.input-text.qty', jQuery(this).parent());
20            var value = parseInt(inputquantity.val()) + 1;
21            inputquantity.val(value);
22            jQuery('.woocommerce-cart table.cart input[name="update_cart"]').prop("disabled", false)
23        });
24    }
25
26    woo_cart_update_buttons();
27
28    jQuery(document.body).on('updated_wc_div', function() {
29        woo_cart_update_buttons();
30    });
31
32    jQuery('.lang_sel_sel.icl-en').on('click', function(e) {
33        if (jQuery(window).width() < 767) {
34            if (jQuery('#lang_sel_click ul li ul').css('visibility') == 'visible') {
35                jQuery('#lang_sel_click ul li ul').css('display', 'hidden');
36            } else {
37                jQuery('#lang_sel_click ul li ul').css('display', 'visible');
38            }
39        };
40    });
41    jQuery('textarea#comment').on('focus', function() {
42        jQuery('.cm-form-info').addClass('cm_show');
43        jQuery('p.form-submit').addClass('form_heig');
44    });
45    jQuery('#uni-project').on('change', function() {
46        var link = jQuery('#uni-project option:selected').val()
47        if (link != undefined) {
48            window.location.href = link;
49        }
50    });
51    //Submenu
52    jQuery('.menu-item-has-children.parent a').on('click', function(e) {
53        var get_att = jQuery(this).attr('href');
54        if (get_att == '#') {
55            jQuery(this).removeAttr('href', '#');
56        }
57    });
58    jQuery('.menu-item-has-children.parent').on('click', function(e) {
59        jQuery('.menu-item-has-children.parent').removeClass('show_submenu');
60        jQuery('.menu-item-has-children.parent .sub-menu').removeClass('show_sub_menu');
61        jQuery(this).addClass('show_submenu');
62        jQuery('.menu-item-has-children.parent.show_submenu .sub-menu').addClass('show_sub_menu');
63    });
64    //carousel
65    jQuery(".is-carousel").each(function() {
66        var carousel_id = jQuery(this).attr('id');
67        var auto_play = (jQuery(this).data('autoplay')) ? true : false;
68        var auto_play_time = jQuery(this).data('autoplay');
69        var items = jQuery(this).data('items');
70        var navigation = jQuery(this).data('navigation');
71        if (jQuery(this).hasClass('single-carousel')) { //single style
72            jQuery(this).addClass('owl-carousel');
73            jQuery(this).owlCarousel({
74                items: 1,
75                autoplay: auto_play,
76                autoplayTimeout: auto_play_time,
77                rtl: check_rtl,
78                loop: true,
79                nav: navigation ? true : false,
80                navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"]
81            });
82        } else {
83            jQuery(this).addClass('owl-carousel');
84            jQuery(this).owlCarousel({
85                autoplay: auto_play,
86                autoplayTimeout: auto_play_time,
87                items: items ? items : 4,
88                loop: true,
89                rtl: check_rtl,
90                nav: navigation ? true : false,
91                navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"],
92                responsive: {
93                    0: {
94                        items: 1
95                    },
96                    768: {
97                        items: items ? (items >= 2 ? 2 : 1) : 2
98                    },
99                    992: {
100                        items: items ? items : 4
101                    }
102                }
103            });
104        }
105    });
106    //grid or carousel
107    if (jQuery(window).width() < 977) {
108        jQuery(".grid-listing").addClass('owl-carousel');
109        jQuery(".grid-listing").owlCarousel({
110            rtl: check_rtl,
111            loop: true,
112            responsive: {
113                0: {
114                    items: 1
115                },
116                768: {
117                    items: 2
118                }
119            }
120        });
121    }
122
123    //Countdown
124    jQuery('[data-countdown]').each(function() {
125        var $this = jQuery(this),
126            finalDate = jQuery(this).data('countdown');
127        var day_label = $this.data('daylabel');
128        var hour_label = $this.data('hourlabel');
129        var minute_label = $this.data('minutelabel');
130        var second_label = $this.data('secondlabel');
131        var show_second = $this.data('showsecond');
132        $this.countdown(finalDate, function(event) {
133            $this.html(event.strftime('' +
134                '<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%D</span><span class="countdown-label main-color-1">' + day_label + '</span></span>' +
135                '<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%H</span><span class="countdown-label main-color-1">' + hour_label + '</span></span>' +
136                '<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%M</span><span class="countdown-label main-color-1">' + minute_label + '</span></span>' +
137                (show_second ? '<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%S</span><span class="countdown-label main-color-1">' + second_label + '</span></span>' : '')
138            ));
139        });
140    });
141    if (jQuery('.colorbox-grid').length) {
142        jQuery('.colorbox-grid').colorbox({
143            rel: function() {
144                return jQuery(this).data('rel');
145            },
146            inline: true,
147            href: function() {
148                if (jQuery(this).data('isgallery')) {
149                    return jQuery(this).data('content') + ' .popup-data-gallery';
150                } else {
151                    return jQuery(this).data('content') + ' .popup-data:not(.popup-data-gallery)';
152                }
153            },
154            top: 110,
155            width: 690,
156            responsive: true,
157            onOpen: function() {
158                jQuery('body').addClass('popup-active');
159            },
160            onClosed: function() {
161                jQuery('body').removeClass('popup-active');
162            },
163            previous: '<i class="fa fa-chevron-left"></i>',
164            next: '<i class="fa fa-chevron-right"></i>',
165            close: '<i class="fa fa-times"></i>',
166        });
167    }
168
169    if (jQuery('.colorbox-video-banner').length) {
170        jQuery('.colorbox-video-banner').colorbox({
171            inline: true,
172            arrowKey: false,
173            href: function() {
174                if (jQuery(this).data('isgallery')) {
175                    return jQuery(this).data('content') + ' .popup-data-gallery';
176                } else {
177                    return jQuery(this).data('content') + ' .popup-data:not(.popup-data-gallery)';
178                }
179            },
180            innerWidth: 853,
181            innerHeight: 480,
182            responsive: true,
183            onOpen: function() {
184                jQuery('body').addClass('popup-active');
185            },
186            onClosed: function() {
187                jQuery('body').removeClass('popup-active');
188            },
189            close: '<i class="fa fa-times"></i>',
190        });
191    }
192    //smooth scroll anchor
193    jQuery('a[href*="#"]:not([href="#"]):not(.cf)').on('click', function() {
194        if (jQuery(this).hasClass('featured-tab') || jQuery(this).hasClass('popup-gallery-comment') || jQuery(this).parents('ul').hasClass('tabs') || jQuery(this).hasClass('comment-reply-link') || jQuery(this).hasClass('ui-tabs-anchor') || jQuery(this).data('vc-container') || jQuery(this).parents('div').hasClass('wpb_tour_next_prev_nav')) {
195            return true;
196        }
196 else if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') ||
197            location.hostname == this.hostname) {
198            var target = jQuery(this.hash);
199            target = target.length ? target : jQuery('[name=' + this.hash.slice(1) + ']');
200            if (target.length) {
201                jQuery('html,body,#body-wrap').animate({
202                    scrollTop: target.offset().top - 50
203                }, 660);
204                return true;
205            }
206        }
207    });
208    jQuery('.wpb_accordion_header a').on('click', function() {
209        thisa = jQuery(this);
210        setTimeout(function() {
211            jQuery('html,body,#body-wrap').animate({
212                scrollTop: thisa.offset().top - 120
213            }, 660);
214        }, 400);
215        return true;
216    });
217
218    //search toggle focus
219    jQuery('#nav-search').on('shown.bs.collapse', function() {
220        jQuery('#nav-search .search-field').focus();
221    });
222    jQuery(document).on('mouseup', function(e) {
223        var container = jQuery("#nav-search");
224        if (!container.is(e.target) && container.has(e.target).length === 0) {
225            jQuery('#nav-search.in').collapse('hide');
226        }
227    });
228
229    //mobile menu
230    jQuery('.mobile-menu-toggle').on('click', function(e) {
231        jQuery('body').toggleClass('enable-mobile-menu');
232        jQuery('body').removeClass('scroll-mobile-menu');
233    });
234    jQuery('.mobile-menu').on('scroll', function(e) {
235        jQuery('body').addClass('scroll-mobile-menu');
236    });
237
238    //paralax
239    var $window = jQuery(window);
240    jQuery('.pc .u_paralax .wpb_row, .pc .is-paralax').each(function() {
241        var $bgobj = jQuery(this); // assigning the object
242        var yPos = -(($window.scrollTop() - $bgobj.offset().top) / 5);
243        var coords = 'background-position: 50% ' + yPos + 'px !important; transition: none;';
244        $bgobj.attr('style', coords);
245
246        jQuery(window).on('scroll', function() {
247            var yPos = -(($window.scrollTop() - $bgobj.offset().top) / 5);
248            // Put together our final background position
249            var coords = 'background-position: 50% ' + yPos + 'px !important; transition: none;';
250            // Move the background
251            $bgobj.attr('style', coords);
252        });
253    });
254
255    //animation delay
256    jQuery('.wpb_animate_when_almost_visible').each(function(index, element) {
257        var delay = jQuery(this).data('delay');
258        if (delay) {
259            var delay_css = 'transition-delay: ' + delay + 's; -webkit-transition-delay: ' + delay + 's; -moz-transition-delay: ' + delay + 's; animation-delay: ' + delay + 's; -webkit-animation-delay: ' + delay + 's; -moz-animation-delay: ' + delay + 's;';
260            jQuery(this).attr('style', delay_css);
261        }
262    });
263
264    //iOS fix
265    jQuery('.event-item').on('touchstart', function(e) {
266        if (!jQuery(this).hasClass('hover_effect')) {
267            e.preventDefault();
268            jQuery('.event-item').removeClass('hover_effect');
269            jQuery(this).toggleClass('hover_effect');
270        }
271    });
272    jQuery('.event-item.hover_effect').on('touchstart', function(e) {
273        return true;
274    });
275
276}); //document ready
277
278jQuery(window).on('resize', function(e) {
279    var check_rtl = false;
280    if (jQuery('body').hasClass('rtl')) {
281        check_rtl = true;
282    }
283    if (jQuery(window).width() < 977) {
284        jQuery(".grid-listing").each(function(index, element) {
285            if (!jQuery(this).hasClass('owl-loaded')) {
286                jQuery(this).addClass('owl-carousel');
287                jQuery(this).owlCarousel({
288                    rtl: check_rtl,
289                    loop: true,
290                    responsive: {
291                        0: {
292                            items: 1
293                        },
294                        768: {
295                            items: 2
296                        }
297                    }
298                });
299            }
300        });
301    } else {
302        jQuery(".grid-listing").each(function(index, element) {
303            if (jQuery(this).hasClass('owl-loaded')) {
304                var owl = jQuery(this).data('owlCarousel');
305                jQuery(this).removeClass('owl-carousel');
306                jQuery(this).trigger('destroy.owl.carousel');
307            }
308        });
309    }
310});
311
312//Post scroller
313jQuery(document).ready(function(e) {
314    jQuery('.post-scroller-carousel').each(function() {
315        //init
316        var this_scroller = jQuery(this);
317        var this_scroller_inner = jQuery('.post-scroller-carousel-inner', this_scroller);
318
319        var bottom_count = 0;
320        //calculate
321        var scroller_height = this_scroller.outerHeight(true);
322        var scroller_list_height = this_scroller_inner.outerHeight(true);
323        var scroller_distance = 0;
324
325        //action
326        jQuery('.post-scroller-item:first-child', this_scroller).addClass('active');
327
328        jQuery(document).on('click', this_scroller.data('next'), function() {
329            var scroller = jQuery(this).parent().parent().prev();
330            var scroller_inner = jQuery('.post-scroller-carousel-inner', scroller);
331            scroller_height = scroller.outerHeight(true);
332            scroller_list_height = scroller_inner.outerHeight(true);
333            active_scroller_item = jQuery('.post-scroller-item.active', scroller);
334            if (active_scroller_item.next().length && scroller_distance < (scroller_list_height - scroller_height)) {
335                active_scroller_item.next().addClass('active')
336                active_scroller_item.removeClass('active');
337            }
338            active_scroller_item = jQuery('.post-scroller-item.active', scroller);
339            //scroller_distance += active_scroller_item.outerHeight();
340            scroller_distance = 0
341            active_scroller_item.prevAll().each(function() {
342                scroller_distance += scroller.outerHeight(true);
343            });
344            if (scroller_distance >= (scroller_list_height - scroller_height)) {
345                scroller_distance = scroller_list_height - scroller_height;
346                //back to top
347                /*
348                bottom_count++;
349                if(bottom_count>2){
350                	bottom_count = 0;
351                	scroller_distance = 0;
352                	active_scroller_item.removeClass('active');
353                	jQuery('.post-scroller-item:first-child',scroller).addClass('active');
354                }*/
355            }
356            scroller_inner.css({
357                'transform': 'translate3d(0px, -' + scroller_distance + 'px, 0px)',
358                '-webkit-transform': 'translate3d(0px, -' + scroller_distance + 'px, 0px)',
359                '-ms-transform': 'translateY(-' + scroller_distance + 'px)',
360            });
361            return false;
362        });
363        jQuery(document).on('click', this_scroller.data('prev'), function() {
364            var scroller = jQuery(this).parent().parent().prev();
365            var scroller_inner = jQuery('.post-scroller-carousel-inner', scroller);
366            scroller_height = scroller.outerHeight(true);
367            scroller_list_height = scroller_inner.outerHeight(true);
368            active_scroller_item = jQuery('.post-scroller-item.active', scroller);
369            if (active_scroller_item.prev().length) {
370                active_scroller_item.prev().addClass('active')
371                active_scroller_item.removeClass('active');
372            }
373            active_scroller_item = jQuery('.post-scroller-item.active', scroller);
374            scroller_distance = 0
375            active_scroller_item.prevAll().each(function() {
376                scroller_distance += scroller.outerHeight(true);
377            });
378            if (scroller_distance >= (scroller_list_height - scroller_height)) {
379                scroller_distance = scroller_list_height - scroller_height;
380            }
381            scroller_inner.css({
382                'transform': 'translate3d(0px, -' + scroller_distance + 'px, 0px)',
383                '-webkit-transform': 'translate3d(0px, -' + scroller_distance + 'px, 0px)',
384                '-ms-transform': 'translateY(-' + scroller_distance + 'px)',
385            });
386            return false;
387        });
388    });
389
390    /*Fix menu hover in mobile (add by vanna)*/
391    jQuery('.navbar-nav li>a').on('touchstart', function(e) {
392        if (jQuery(this).parents('li').find('ul').length > 0 && !jQuery(this).hasClass('no-go-to-touch')) {
393            jQuery(this).addClass('no-go-to-touch');
394            return false;
395        };
396    });
397    /*Fix menu hover in mobile*/
398});
399jQuery(window).on('resize', function(e) {
400    jQuery('.post-scroller-carousel').each(function() {
401        //init
402        var this_scroller = jQuery(this);
403        var this_scroller_inner = jQuery('.post-scroller-carousel-inner', this);
404        //calculate
405        var scroller_height = this_scroller.height();
406        var scroller_list_height = this_scroller_inner.height();
407
408        var active_scroller_item = jQuery('.post-scroller-item.active', this);
409        var scroller_distance = 0
410        active_scroller_item.prevAll().each(function() {
411            scroller_distance += jQuery(this).outerHeight(true);
412        });
413        if (scroller_distance >= (scroller_list_height - scroller_height)) {
414            scroller_distance = scroller_list_height - scroller_height;
415        }
416        jQuery('.post-scroller-carousel-inner', this).css({
417            'transform': 'translate3d(0px, -' + scroller_distance + 'px, 0px)',
418            '-webkit-transform': 'translate3d(0px, -' + scroller_distance + 'px, 0px)',
419        });
420    });
421});
422//End Post scroller
423
424//Pre loading
425jQuery(window).on('load', function(e) {
426    jQuery("#pageloader").fadeOut(500);
427});
428
429// Add some classes to body for CSS hooks
430// Get browser
431if (jQuery.browser) {
432    jQuery.each(jQuery.browser, function(i) {
433        jQuery('body').addClass(i);
434        return false;
435    });
436}
437// Get OS
438var os = [
439    'iphone',
440    'ipad',
441    'windows',
442    'mac',
443    'linux',
444    'android',
445    'mobile'
446];
447var match = navigator.appVersion.toLowerCase().match(new RegExp(os.join('|')));
448if (match) {
449    jQuery('body').addClass(match[0]);
450}
451if (typeof match[0] == 'undefined') {
452    match[0] = '';
453}
454if ((navigator.appVersion.indexOf("Win") != -1 || navigator.appVersion.indexOf("Mac") != -1 || navigator.appVersion.indexOf("X11") != -1 || match[0] == 'windows' || match[0] == 'mac') && match[0] != 'iphone' && match[0] != 'ipad') {
455    jQuery('body').addClass('pc');
456} else {
457    jQuery('body').addClass('mobile');
458}
459//End body class

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.