PageSourceSearch

https://crafft.org/wp-content/themes/education-base/assets/js/education-base-custom.js?ver=1.4.6

js crafft.org collected 2026-10-02 10:45:00 UTC 5,923 bytes, 197 lines download raw bytes

1jQuery(document).ready(function($){
2    var at_window = $(window),
3        at_body = $('body');
4
5    /*custom ticker by @acmethemes*/
6    var ticker = $('.news-notice-content'),
7        ticker_first = ticker.children(':first');
8
9    if( ticker_first.length ){
10        setInterval(function() {
11            if ( !ticker_first.is(":hover") ){
12                ticker_first.fadeOut(function() {
13                    ticker_first.appendTo(ticker);
14                    ticker_first = ticker.children(':first');
15                    ticker_first.fadeIn();
16                });
17            }
18        },3000);   
19    }
20    
21    function homeFullScreen() {
22
23        var homeSection = $('#at-banner-slider');
24        var windowHeight = at_window.outerHeight();
25
26        if (homeSection.hasClass('home-fullscreen')) {
27
28            $('.home-fullscreen').css('height', windowHeight);
29        }
30    }
31    //make slider full width
32    homeFullScreen();
33
34    //window resize
35    at_window.resize(function () {
36        homeFullScreen();
37        appendMenuIcon();
38    });
39
40    at_window.on("load", function() {
41        // function goes here
42    });
43
44    $('.acme-owl-carausel').show().owlCarousel({
45        autoPlay : true,
46        navigation : true, // Show next and prev buttons
47        pagination : false, // Show next and prev buttons
48        slideSpeed : 800,
49        paginationSpeed : 600,
50        singleItem:true,
51        navigationText : ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
52        addClassActive: true
53    });
54
55    /*parallax scolling*/
56    $('a[href*="\\#"]').click(function(event){
57        var at_offset= $.attr(this, 'href');
58        var at_navbar= $('.at-navbar');
59        var id = at_offset.substring(1, at_offset.length);
60        if ( ! document.getElementById( id ) ) {
61            return;
62        }
63        if( $( at_offset ).offset() ){
64            var offset_height = at_navbar.height()*2 + 30;
65            if( at_navbar.hasClass('navbar-fixed-top')){
66                offset_height = (offset_height - 30)/2;
67            }
68            $('html, body').animate({
69                scrollTop: $( at_offset ).offset().top-offset_height
70            }, 1000);
71        }
72    });
73
74    /*bootstrap sroolpy*/
75    $("body").scrollspy({target: ".navbar-fixed-top", offset: $('.at-navbar').height()+50 } );
76
77    /*featured slider*/
78    $('.acme-gallery').each(function(){
79        var $masonry_boxes = $(this);
80        var $container = $masonry_boxes.find('.fullwidth-row');
81        $container.imagesLoaded( function(){
82            $masonry_boxes.fadeIn( 'slow' );
83            $container.masonry({
84                itemSelector : '.at-gallery-item'
85            });
86        });
87        /*widget*/
88        $masonry_boxes.find('.image-gallery-widget').magnificPopup({
89            type: 'image',
90            gallery: {
91                enabled: true
92            }
93
94        });
95        $masonry_boxes.find('.single-image-widget').magnificPopup({
96            type: 'image'
97        });
98    });
99
100    function stickyMenu() {
101        var sticky_header = $('.at-sticky-header .education-base-main-header-wrapper');
102        if ( sticky_header.length ) {
103            at_body.css('padding-top',sticky_header.height())
104        }
105        var scrollTop = at_window.scrollTop();
106        var offset = 0;
107
108        if ( scrollTop > offset ) {
109            $('.education-base-sticky').addClass('navbar-fixed-top');
110            $('.sm-up-container').show();
111        }
112        else {
113            $('.education-base-sticky').removeClass('navbar-fixed-top');
114            $('.sm-up-container').hide();
115        }
116    }
117    //What happen on window scroll
118    stickyMenu();
119    at_window.on("scroll", function (e) {
120        setTimeout(function () {
121            stickyMenu();
122        }, 300)
123    });
124
125    /*Append icon*/
126    function appendMenuIcon(){
127        if( $(window).width() <=1023){
128            if( !$('.main-navigation .menu-item-has-children .at-submenu-icon').length ){
129                $('.main-navigation .menu-item-has-children').append('<i class="at-submenu-icon fa fa-angle-down"></i>');
130            }
131        }
132        else{
133            $('.main-navigation .menu-item-has-children .at-submenu-icon').remove();
134        }
135    }
136    appendMenuIcon()
137    /*Navbar custom functions*/
138    $(document).on("click", ".at-submenu-icon", function(e) {
139        e.preventDefault();
140        let submenu = $(this).siblings('.sub-menu');
141        if ($(submenu).is(':hidden')) {
142            $(this).removeClass('fa-angle-down');
143            $(this).addClass('fa-angle-up');
144            $(this).parent().addClass('at-submenu-active');
145            $(submenu).slideDown(200);
146        } else {
147            $(this).addClass('fa-angle-down');
148            $(this).removeClass('fa-angle-up');
149            $(submenu).slideUp(200);
150            $(this).parent().removeClass('at-submenu-active')
151
152        }
153    });
154
155});
156
157/*animation with wow*/
158
159if(typeof WOW !== 'undefined'){
160    eb_wow = new WOW({
161            boxClass: 'init-animate',
162            animateClass: 'animated' // default
163        }
164    );
165    eb_wow.init();
166}
167
168/**
169 * Skip link focus fixed
170 */
171( function() {
172    var isIe = /(trident|msie)/i.test( navigator.userAgent );
173    if ( isIe && document.getElementById && window.addEventListener ) {
174        window.addEventListener(
175            'hashchange',
176            function() {
177                var id = location.hash.substring( 1 ),
178                    element;
179
180                if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
181                    return;
182                }
183
184                element = document.getElementById( id );
185
186                if ( element ) {
187                    if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
188                        element.tabIndex = -1;
189                    }
190
191                    element.focus();
192                }
193            },
194            false
195        );
196    }
197}() );

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.