PageSourceSearch

https://www.comex.go.cr/scripts/main.js

js comex.go.cr collected 2026-09-24 21:07:05 UTC 8,051 bytes, 284 lines download raw bytes

1/* 
2   CounterUp
3   ========================================================================== */
4jQuery(document).ready(function($) {
5    $('.counter').counterUp({
6        time: 500
7    });
8
9    $('#portfolio').mixItUp();
10
11    $(".owl-carousel").owlCarousel({
12        autoPlay: true,
13        slideSpeed: 1000,
14        stopOnHover: true,
15        pagination: true,
16        loop: true,
17        margin: 10,
18        navigation: false,
19        navigationText: [
20            "<",
21            ">"
22        ],
23        items: 3,
24        responsiveClass: true,
25        responsive: {
26            0: {
27                items: 1
28            },
29            768: {
30                items: 3
31            },
32            960: {
33                items: 3
34            },
35            1200: {
36                items: 3
37            },
38            1920: {
39                items: 3
40            }
41        }
42    });
43
44
45
46    $('.owl-carousel').find('.owl-prev').html('<');
47    $('.owl-carousel').find('.owl-next').html('>');
48
49    $(window).on('scroll', function() {
50        if ($(window).scrollTop() > 200) {
51            $('.header-top-area').addClass('menu-bg');
52            $('#menu-logo-1').addClass('hidden');
53            $('#menu-logo-2').removeClass('hidden');
54        } else {
55            $('.header-top-area').removeClass('menu-bg');
56            $('#menu-logo-2').addClass('hidden');
57            $('#menu-logo-1').removeClass('hidden');
58        }
59    });
60
61    $('.video-popup').magnificPopup({
62        disableOn: 700,
63        type: 'iframe',
64        mainClass: 'mfp-fade',
65        removalDelay: 160,
66        preloader: false,
67        fixedContentPos: false,
68    });
69
70    var offset = 200;
71    var duration = 500;
72    $(window).on('scroll',function() {
73        if ($(this).scrollTop() > offset) {
74            $('.back-to-top').fadeIn(400);
75            $('.back-to-down').fadeOut(400);
76        } else {
77            $('.back-to-top').fadeOut(400);
78            $('.back-to-down').fadeIn(400);
79        }
80    });
81    $('.back-to-top').on('click',function(event) {
82        event.preventDefault();
83        $('html, body').animate({
84            scrollTop: 0
85        }, 600);
86        return false;
87    });
88    
89    $('.back-to-down').on('click',function(event) {
90        event.preventDefault();
91        $('html, body').animate({
92            scrollTop: 400
93        }, 600);
94        return false;
95    });
96
97    new WOW().init();
98
99    // one page navigation 
100    $('.main-navigation').onePageNav({
101        currentClass: 'active'
102    });
103
104    $('body').scrollspy({
105        target: '.navbar-collapse',
106        offset: 195
107    });
108
109    $(window).on('scroll', function() {
110        if ($(window).scrollTop() > 200) {
111            $('.fixed-top').addClass('menu-bg');
112        } else {
113            $('.fixed-top').removeClass('menu-bg');
114        }
115    });
116
117    $('.lightbox').nivoLightbox({
118        effect: 'fadeScale',
119        keyboardNav: true,
120    });
121
122/*
123
124    $.stellar({
125        horizontalScrolling: false,
126        verticalOffset: 40,
127        responsive: true
128    });
129*/
130
131    $('#zoom-less').on('click', function(e) {
132        e.preventDefault();
133        var body = $('body');
134        if (body.hasClass('zoom-0')) return;
135        else if (body.hasClass('zoom-1')) body.removeClass('zoom-1').addClass('zoom-0');
136        else if (body.hasClass('zoom-2')) body.removeClass('zoom-2').addClass('zoom-1');
137        else if (body.hasClass('zoom-3')) body.removeClass('zoom-3').addClass('zoom-2');
138        else if (body.hasClass('zoom-4')) body.removeClass('zoom-3').addClass('zoom-3');
139    });
140
141    $('#zoom-more').on('click', function(e) {
142        e.preventDefault();
143        var body = $('body');
144        if (body.hasClass('zoom-0')) body.removeClass('zoom-0').addClass('zoom-1');
145        else if (body.hasClass('zoom-1')) body.removeClass('zoom-1').addClass('zoom-2');
146        else if (body.hasClass('zoom-2')) body.removeClass('zoom-2').addClass('zoom-3');
147        else if (body.hasClass('zoom-3')) body.removeClass('zoom-3').addClass('zoom-4');
148        else if (body.hasClass('zoom-4')) return;
149    });
150
151    setNewsWidth();
152});
153
154/* 
155   Page Loader
156   ========================================================================== */
157$(window).on('load',function() {
158    "use strict";
159    $('#loader').fadeOut();
160});
161$(window).on('resize', setNewsWidth);
162
163function setNewsWidth() {
164    var containerWidth = $('#posts-carousel-3col').width();
165    if (containerWidth > 768) $('#posts-carousel-3col').find('.owl-item').width(Math.round(containerWidth / 3));
166    else if (containerWidth <= 768 && containerWidth >= 480) $('#posts-carousel-3col').find('.owl-item').width(Math.round(containerWidth / 2));
167    else if (containerWidth < 480) $('#posts-carousel-3col').find('.owl-item').width(Math.round(containerWidth));
168
169    if (containerWidth >= 768) $('#posts-carousel-3col').find('.carousel-post').width(Math.round(containerWidth / 3) - 80);
170}
171
172var fullWidth = $('body').width();
173var vids = $("video#demo"); 
174if(vids.length){
175    $.each(vids, function(){ 
176        this.controls = fullWidth <= 480 ? true : false;
177        this.autoplay = true;
178    });
179} 
180
181/* 
182  Galeria
183  ========================================================================== */
184
185$(document).ready(function() {
186
187    $(".filter-button").on('click',function() {
188        var value = $(this).attr('data-filter');
189
190        if (value == "all") {
191            //$('.filter').removeClass('hidden');
192            $('.filter').show('1000');
193        } else {
194            //            $('.filter[filter-item="'+value+'"]').removeClass('hidden');
195            //            $(".filter").not('.filter[filter-item="'+value+'"]').addClass('hidden');
196            $(".filter").not('.' + value).hide('3000');
197            $('.filter').filter('.' + value).show('3000');
198
199        }
200    });
201
202    if ($(".filter-button").removeClass("active")) {
203        $(this).removeClass("active");
204    }
205    $(this).addClass("active");
206
207});
208
209/* 
210   Menu
211   ========================================================================== */
212
213// Hide Header on on scroll down
214var didScroll;
215var lastScrollTop = 0;
216var delta = 5;
217var navbarHeight = $('.fixed-top').outerHeight();
218
219$(window).on('scroll',function(event) {
220    didScroll = true;
221});
222setInterval(function() {
223
224    if (didScroll) {
225        hasScrolled();
226        didScroll = false;
227    }
228}, 250);
229
230function hasScrolled() {
231    var st = $(this).scrollTop();
232
233    // Make sure they scroll more than delta
234    if (Math.abs(lastScrollTop - st) <= delta)
235        return;
236
237    // If they scrolled down and are past the navbar, add class .nav-up.
238    // This is necessary so you never see what is "behind" the navbar.
239    if (st > lastScrollTop && st > navbarHeight) {
240        // Scroll Down
241        $('.fixed-top').removeClass('nav-down').addClass('nav-up');
242    } else {
243        // Scroll Up
244        $('.fixed-top').removeClass('nav-up').addClass('nav-down');
245        if (st + $(window).height() < $(document).height()) {}
246    }
247
248    lastScrollTop = st;
249}
250
251/* 
252   Modal
253   ========================================================================== */
254$('#myModal').on('shown.bs.modal', function() {
255    $('#myInput').focus()
256})
257
258/* 
259   PopOver
260   ========================================================================== */
261
262$('.btn-no[data-toggle="popover"]').popover({
263    html: true,
264    container: 'body',
265    content: function () {
266        var H = $('#whyNo');
267        return $(H).html();
268    }
269})
270
271/* 
272   About Tabs Expand
273   ========================================================================== */
274
275function changeHeightMore(){
276    $('.og-grid').height(function (index, height) {
277        return (height + $('.og-expander').height());
278    });
279        
280}
281function changeHeightLess(){
282    $('.og-grid').css("height", "auto");
283}
284    

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.