PageSourceSearch

https://www.ebtechnology.it/templates/etnotarix/js/main.js

js ebtechnology.it collected 2026-10-09 02:44:51 UTC 3,814 bytes, 128 lines download raw bytes

1/**
2 * @package Helix Ultimate Framework
3 * @author enginetemplates https://www.enginetemplates.com
4 * @copyright Copyright (c) 2010 - 2018 enginetemplates.com
5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
6*/
7
8jQuery(function ($) {
9
10    // Stikcy Header
11    if ($('body').hasClass('sticky-header')) {
12        var header = $('#sp-header');
13
14        if($('#sp-header').length) {
15            var headerHeight = header.outerHeight();
16            var stickyHeaderTop = header.offset().top;
17            var stickyHeader = function () {
18                var scrollTop = $(window).scrollTop();
19                if (scrollTop > stickyHeaderTop) {
20                    header.addClass('header-sticky');
21                } else {
22                    if (header.hasClass('header-sticky')) {
23                        header.removeClass('header-sticky');
24                    }
25                }
26            };
27            stickyHeader();
28            $(window).scroll(function () {
29                stickyHeader();
30            });
31        }
32
33        if ($('body').hasClass('layout-boxed')) {
34            var windowWidth = header.parent().outerWidth();
35            header.css({"max-width": windowWidth, "left": "auto"});
36        }
37    }
38
39    // go to top
40    $(window).scroll(function () {
41        if ($(this).scrollTop() > 100) {
42            $('.sp-scroll-up').fadeIn();
43        } else {
44            $('.sp-scroll-up').fadeOut(400);
45        }
46    });
47
48    $('.sp-scroll-up').click(function () {
49        $("html, body").animate({
50            scrollTop: 0
51        }, 600);
52        return false;
53    });
54
55    // Preloader
56    $(window).on('load', function () {
57        $('.sp-preloader').fadeOut(500, function() {
58            $(this).remove();
59        });
60    });
61
62    //mega menu
63    $('.sp-megamenu-wrapper').parent().parent().css('position', 'static').parent().css('position', 'relative');
64    $('.sp-menu-full').each(function () {
65        $(this).parent().addClass('menu-justify');
66    });
67
68    // Offcanvs
69    $('#offcanvas-toggler').on('click', function (event) {
70        event.preventDefault();
71        $('.offcanvas-init').addClass('offcanvas-active');
72    });
73
74    $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) {
75        event.preventDefault();
76        $('.offcanvas-init').removeClass('offcanvas-active');
77    });
78    
79    $(document).on('click', '.offcanvas-inner .menu-toggler', function(event){
80        event.preventDefault();
81        $(this).closest('.menu-parent').toggleClass('menu-parent-open').find('>.menu-child').slideToggle(400);
82    });
83
84    //Tooltip
85    $('[data-toggle="tooltip"]').tooltip();
86
87    // Article Ajax voting
88    $('.article-ratings .rating-star').on('click', function (event) {
89        event.preventDefault();
90        var $parent = $(this).closest('.article-ratings');
91
92        var request = {
93            'option': 'com_ajax',
94            'template': template,
95            'action': 'rating',
96            'rating': $(this).data('number'),
97            'article_id': $parent.data('id'),
98            'format': 'json'
99        };
100
101        $.ajax({
102            type: 'POST',
103            data: request,
104            beforeSend: function () {
105                $parent.find('.fa-spinner').show();
106            },
107            success: function (response) {
108                var data = $.parseJSON(response);
109                $parent.find('.ratings-count').text(data.message);
110                $parent.find('.fa-spinner').hide();
111
112                if(data.status)
113                {
114                    $parent.find('.rating-symbol').html(data.ratings)
115                }
116
117                setTimeout(function(){
118                    $parent.find('.ratings-count').text('(' + data.rating_count + ')')
119                }, 3000);
120            }
121        });
122    });
123
124
125});
126
127
128

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.