(function ($) { $('.counter').each(function () { $(this).prop('Counter', 0).animate({ Counter: $(this).text() }, { duration: 3000, easing: 'swing', step: function (now) { $(this).text(Math.ceil(now)); } }); }); jQuery('.widget-title span').on('click', function () { //jQuery(this).parent().next().slideToggle(); //jQuery(this).parent().toggleClass('active'); }); jQuery('.widget-title').on('click', function () { jQuery(this).next().slideToggle(); jQuery(this).toggleClass('active'); }); //History slider//////////////////////////////////////// jQuery(document).ready(function ($) { var column_index = 0; var column_number = []; $('#tableDate thead th').each(function () { if ($(this).hasClass('hide_cat')) { column_number.push(column_index); } column_index++; }); console.log(column_number); var table = $('#tableDate').DataTable({ paginate: false, info: false, dom: 'Bfrtip', buttons: [ 'excelHtml5', ], columnDefs: [ { "targets": column_number, "visible": false, }, ] }); var length = $('.filter-body .filter-list:last-child').data('column'); console.log(length); $('input:checkbox').on('change', function () { for (var i = 2; i <= length; i++) { //build a filter string with an or(|) condition var row_search = $('input:checkbox[name="column' + i + '"]:checked').map(function () { return this.value; }).get().join('|'); //now filter in column 2, with no regex, no smart filtering, not case sensitive table.column(i).search(row_search, true, false, false).draw(false); } }); $('.btn-export').on('click', function (e) { e.preventDefault(); $('.buttons-excel').trigger('click'); }); $("#checkAll").click(function () { $('input.check_item:checkbox').not(this).prop('checked', this.checked); }); var product_slider = $('.product__slider__inner'); product_slider.slick({ prevArrow: product_slider.next('.slider-arrows').find('.prev'), nextArrow: product_slider.next('.slider-arrows').find('.next'), }); var banner__slider = $('.banner__slider'); banner__slider.slick({ autoplay: true, autoplaySpeed: 5000, fade: true, cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)', prevArrow: banner__slider.next('.banner-slider-arrows').find('.prev'), nextArrow: banner__slider.next('.banner-slider-arrows').find('.next'), }); var certs_slider = $('.certs_slider_inner'); certs_slider.slick({ slidesToShow: 3, prevArrow: certs_slider.next('.slider-arrows').find('.prev'), nextArrow: certs_slider.next('.slider-arrows').find('.next'), responsive: [ { breakpoint: 1250, settings: { slidesToShow: 2, } }, { breakpoint: 850, settings: { slidesToShow: 1, dots: true, } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); $(".pdfemb-viewer").on("contextmenu", function(){return false;}); var app_slider = $('.product__applications__slider'); app_slider.slick({ slidesToShow: 1, slidesToScroll: 1, mobileFirst: true, dots: false, prevArrow: app_slider.next('.slider-arrows').find('.prev'), nextArrow: app_slider.next('.slider-arrows').find('.next'), responsive: [ { breakpoint: 750, settings: { slidesToShow: 2, } }, { breakpoint: 1024, settings: 'unslick' } ] }); // $('.product-nav ul li a').on('click', function (e) { // e.preventDefault(); // // $('.product-nav ul li a').removeClass('active'); // $(this).addClass('active'); // // var id = $(this).attr('href'); // // $('html, body').animate({ // scrollTop: $(id).offset().top - 50 // }, 1000); // }); // jQuery('.main-menu').on('beforeshow', function (e) { // if (jQuery(e.target).hasClass('level-div-1')) e.preventDefault(); // }); // jQuery('.main-menu').on('show', function (e) { // var h = 0; // var h1 = jQuery(e.target).innerHeight(); // if (jQuery(e.target).hasClass('level-div-1')) h1 = jQuery(e.target).parent().parent().parent().innerHeight(); // if (jQuery(e.originalEvent.path[0]).find('.level-div-1').length || jQuery(e.originalEvent.path[0]).hasClass('level-div-1')) { // h = h1 + 1; // jQuery('.uk-navbar-dropbar.uk-navbar-dropbar-slide').css('height', '' + h + 'px') // } else jQuery('.uk-navbar-dropbar.uk-navbar-dropbar-slide').css('height', '103px'); // }); //jQuery('.main-menu').on('hide', function(e){ //if(jQuery(e.srcElement).hasClass('level-div-1')){jQuery('.uk-navbar-dropbar.uk-navbar-dropbar-slide').css('height','103px')} //}); // $('body').on('click', '.level-div-0 .uk-icon', function () { // jQuery('.main-menu').find('.uk-drop').removeClass('uk-open'); // jQuery('.main-menu').find('a').removeClass('uk-open'); // jQuery('.uk-navbar-dropbar.uk-navbar-dropbar-slide').css('height', '0px'); // }); $('.menu-humburgur-icon').on('click', function () { $(this).toggleClass('open'); $('body, html').toggleClass('hidden-menu'); }) $(".rst_href_id").click(function (e) { e.preventDefault(); $(this).parent().parent().find('li').removeClass('rst_active'); $(this).parent().addClass('rst_active'); $('html, body').animate({ scrollTop: $("#list_bottom").offset().top }, 300); }); $('.rst_sub_page li a[href*="#"]:not([href="#"])').click(function (e) { e.preventDefault(); var subHeight = $('.rst_sub_page').innerHeight(); var target = $(this.hash); $(this).parent().parent().find('li').removeClass('rst_active'); $(this).parent().addClass('rst_active'); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { if(!$('.rst_sub_page').hasClass('fixed')){ $('html, body').animate({ scrollTop: target.offset().top - 180 }, 300); } else $('html, body').animate({ scrollTop: target.offset().top }, 300); return false; } }); $('.rst-search-form').submit(function (e) { if (!$(this).hasClass('open')) { e.preventDefault(); $('.rst-search-form').addClass('open').removeClass('exit'); $(this).find('input').focus(); } else { if ($(this).find('input').val().length === 0) { e.preventDefault(); $(this).find('input').focus(); } else { return true; } } }); $(document).click(function (event) { if (!$(event.target).is('.rst-search-form') && !$(event.target).is('.rst-search-form *')) { $('.rst-search-form').removeClass('open').addClass('exit'); } }); function changeItem() { var nextIndex = 0; $('.rst_list_year li').each(function (index) { var nextIndex = index; if ($(this).find('a').hasClass('year_active')) { if (index == ($('.rst_list_year li').length - 1)) { console.log("i:" + index); nextIndex = 0; display(nextIndex); console.log("Next i:" + nextIndex); } if (index < ($('.rst_list_year li').length - 1)) { console.log("i1:" + index); nextIndex = index + 2; display(nextIndex); console.log("Next i1:" + nextIndex); return false; } } }) } function display(nextIndex) { $('.rst_list_year li').find('a').removeClass('year_active'); if (nextIndex == 0) { $('.rst_list_year li:first-child').find('a').addClass('year_active'); var target = $('.rst_list_year li:first-child').find('a').attr('href'); } else { $('.rst_list_year li:nth-child(' + nextIndex + ')').find('a').addClass('year_active'); var target = $('.rst_list_year li:nth-child(' + nextIndex + ')').find('a').attr('href'); } $('.rst_section_history').fadeOut('fast'); $(target).fadeIn('slow'); $(target).find('.rst_section_history_bg').hide().addClass('animated Ngoc').show(); $(target).find('.rst_content_history').hide().addClass('animated slideInUp delay-0.5s').show(); return false; } var run = setInterval(function () { changeItem(); }, 7000); $('.prev_btn').on('click', function (e) { e.preventDefault(); var preIndex = 0; $('.rst_list_year li').each(function (index) { if ($(this).find('a').hasClass('year_active')) { if (index > 0) preIndex = index; else preIndex = $('.rst_list_year li').length; } }); display(preIndex); clearInterval(run); run = setInterval(function () { changeItem(); }, 7000); }) $('.next_btn').on('click', function (e) { e.preventDefault(); var preIndex = 0; $('.rst_list_year li').each(function (index) { if ($(this).find('a').hasClass('year_active')) { if (index < $('.rst_list_year li').length - 1) preIndex = index + 2; else preIndex = 1; } }); display(preIndex); clearInterval(run); run = setInterval(function () { changeItem(); }, 7000); }) jQuery('.rst_list_year li a').click(function (e) { e.preventDefault(); var obj = $(this); jQuery('.rst_list_year li a').removeClass('year_active'); jQuery(obj).addClass('year_active'); var id = jQuery(obj).attr('href'); jQuery('.rst_section_history').fadeOut(); jQuery(id).fadeIn('slow'); jQuery(id).find('.rst_section_history_bg').hide().addClass('animated Ngoc').show(); jQuery(id).find('.rst_content_history').hide().addClass('animated slideInUp delay-0.5s').show(); clearInterval(run); run = setInterval(function () { changeItem(); }, 7000); }); jQuery('.rst_tab_search li a').click(function (e) { e.preventDefault(); var obj = $(this); jQuery('.rst_tab_search li a').removeClass('active_tab'); jQuery(obj).addClass('active_tab'); var id = jQuery(obj).attr('href'); jQuery('.rst_container_search').fadeOut(); jQuery(id).fadeIn(); }); jQuery('.rst_content_leader_right li a').click(function (e) { e.preventDefault(); var obj = $(this); jQuery('.rst_content_leader_right li a').removeClass('active_leader'); jQuery(obj).addClass('active_leader'); var id = jQuery(obj).attr('href'); jQuery('.tab_leader').hide(); jQuery(id).show(); }); $('.rst_content_leader_select').on('change', function () { var id = this.value; jQuery('.tab_leader').hide(); jQuery(id).show(); }); jQuery('.rst_content_leader_right li a').click(function (e) { e.preventDefault(); var obj = $(this); jQuery('.rst_content_leader_right li a').removeClass('active_leader'); jQuery(obj).addClass('active_leader'); var id = jQuery(obj).attr('href'); jQuery('.tab_leader').hide(); jQuery(id).fadeIn(); }); jQuery('.rst-heading-job').click(function (e) { e.preventDefault(); var obj = $(this); if ($(this).hasClass('active_job')) { $(this).removeClass('active_job'); jQuery('.rst-content-job').slideUp(); } else { jQuery('.rst-heading-job').removeClass('active_job'); jQuery(obj).addClass('active_job'); jQuery('.rst-content-job').slideUp(); jQuery(obj).next().slideDown(); } }); //Recu jQuery('.rst_content_enrollment.recruitment li').click(function (e) { e.preventDefault(); var obj = $(this); if ($(this).hasClass('active_job')) { $(this).removeClass('active_job'); jQuery('.rst-content-job').slideUp(); } else { jQuery('.rst_content_enrollment.recruitment li').removeClass('active_job'); jQuery(obj).addClass('active_job'); jQuery('.rst-content-job').slideUp(); jQuery(obj).find('.rst-content-job').slideDown(); } }); jQuery('.rst_click_code a').hover(function () { jQuery('body').addClass('mailsent'); }); jQuery('.rst_click_code a').on('click', function (e) { e.preventDefault(); jQuery('body').addClass('mailsent'); }); jQuery('.rst-close2').on('click', function (e) { e.preventDefault(); jQuery('body').removeClass('mailsent'); }); jQuery('.rst-control-input label').on('click', function (e) { e.preventDefault(); jQuery(this).parent().find('label').hide(); jQuery(this).parent().find('input').focus(); jQuery(this).parent().find('textarea').focus(); }); jQuery('.rst-control-input input,.rst-control-input textarea').focus(function () { jQuery(this).parents('.rst-control-input').find('label').hide(); }); jQuery('.rst-control-input-select label').on('click', function (e) { e.preventDefault(); //alert(11); //jQuery(this).parent().find('label').hide(); }); $(".rst_form_contact select").change(function () { el = $(this); if (el.val() != '') { el.parents('.rst-control-input-select').find('>label').hide(); } else { el.parents('.rst-control-input-select').find('>label').show(); } }); $(".rst_form_contact input").blur(function () { el = $(this); if (el.val() == '') { el.parents('.rst-control-input').find('label').show(); } }); $(".rst_form_contact textarea").blur(function () { el = $(this); if (!$.trim(el.val())) { el.parents('.rst-control-input').find('label').show(); } }); }); ////////////////////end////////////////////////////// $(".mmenu .uk-nav > .uk-parent > a").click(function (e) { e.preventDefault(); if ($(this).hasClass('active')) { $(this).removeClass('active'); $(this).parent().find('.uk-nav-sub').slideUp(400); } else { $(this).addClass('active'); $('.uk-nav-sub').slideUp(400); $(this).parent().find('.uk-nav-sub').slideDown(400); } }); var options = { useEasing: true, useGrouping: true, separator: ',', decimal: '.', prefix: '', suffix: '' }; if ($('.rst_fact_number.rst_yes').length) { $('.rst_fact_number.rst_yes').each(function () { var el = jQuery(this), inited = false; el.appear({force_process: true}); el.on('appear', function () { if (!inited) { var end = jQuery(this).attr('data-end') * 1; var demo = new CountUp(this, 0, end, 0, 2.5, options); demo.start(); inited = true; } }); }); } function show_popup() { $(".videobg video").show(); }; window.setTimeout(show_popup, 5000); // 5 seconds if ($('.rst_sub_page').length > 0) { $(window).scroll(function () { var top = $(window).scrollTop(), offset = $('.rst_sub_page_wrapper').offset().top; if(offset <= top) { $('.rst_sub_page').addClass('fixed'); if($(window).width() > 767){ $('#header').hide(); } }else{ $('.rst_sub_page').removeClass('fixed'); if($(window).width() > 767){ $('#header').show(); } } }); } $.fn.isInViewport = function () { var elementTop = $(this).offset().top; var elementBottom = elementTop + $(this).outerHeight(); var viewportTop = $(window).scrollTop(); var viewportBottom = viewportTop + $(window).height(); return elementBottom > viewportTop && elementTop < viewportBottom; }; if (!$('#header').isInViewport(true)) { $('.scroll-top').fadeIn('fast'); } $(".scroll-top").click(function () { $("html, body").animate({scrollTop: 0}, "2000"); return false; }); $(window).scroll(function () { var top = $(window).scrollTop(), offset = $('#header').offset().top; if (top < 100) { $('.scroll-top').fadeOut('slow'); } else $('.scroll-top').fadeIn('fast'); var menu = $('.main-menu'); var menu_h = menu.height(); if (top > 35) { menu.addClass('fixed'); menu.prev('.top-menu').css('marginBottom', menu_h); } else { menu.removeClass('fixed'); menu.prev('.top-menu').css('marginBottom', 0); } }); if (/MSIE 10/i.test(navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/\d./i.test(navigator.userAgent)) { $('html').attr('data-ie', 'true') } })(jQuery);