(function ($) { $(window).load(function () { EqualSizer('.sp-tabs .nav-tabs li a,.list-pro-cate .col-md-4 .item .title > a, .tabs-contact .nav-tabs > li > a, .pic-content .item, .bot-achievement .item'); //setHeightNH(); }); $(window).ready(function () { }); $(window).resize(function () { //setHeightNH(); }); $(function () { myfunload(); mymap(); }); })(jQuery); //function=============================================================================================== /*=============================fun=========================================*/ function myfunload() { $(".panel-a").mobilepanel(); $("#menu > li").not(".home").clone().appendTo($("#menuMobiles")); $("#menuMobiles input").remove(); $("#menuMobiles > li > a").append(''); $("#menuMobiles li li a").append(''); $("#menu > li:last-child").addClass("last"); $("#menu > li:first-child").addClass("fisrt"); //$("#menu > li").find("ul").addClass("menu-level"); //$('#menu li').hover(function () { // $(this).children('ul').stop(true, false, true).slideToggle(300); //}); /*===== set data-img = background =====*/ //var a = $(".it-tm .items-img").attr("data-img"); //var b = $(".it-dv .items-img").attr("data-img"); //$(".it-tm .items-img").css({ "background-image": "url(" + a + ")" }); //$(".it-dv .items-img").css({ "background-image": "url(" + b + ")" }); /*======= language =======*/ $(".flag-curent").click(function () { $(this).toggleClass("current"); var idflag = $(this).attr("href"); $(idflag).fadeToggle(); return false; }); $(".list-languge li a").click(function (e) { var idliflag = $(this).find('img').attr('src'); var idcurrentflag = $('.flag-curent').find('img').attr('src'); $('.flag-curent').find('img').attr('src', idliflag); $(this).find('img').attr('src', idcurrentflag); $('.list-languge').fadeToggle(); }); /** slick **/ $('.tab-project-content').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, infinite: false, draggable: false, asNavFor: '.tab-project-slide' }); $('.tab-project-slide') .on({ afterChange: function (event, slick, currentSlide, nextSlide) { $('.tab-project-slide .slick-slide').removeClass('active'); $('.tab-project-slide .slick-slide .items-tab').removeClass('active'); $('.tab-project-slide .slick-slide[data-slick-index=' + currentSlide + '] .items-tab').addClass('active'); //console.log($('.tab-project-slide .slick-slide[data-slick-index=' + currentSlide + ']').length); } }) .slick({ slidesToShow: 6, slidesToScroll: 1, asNavFor: '.tab-project-content', vertical: true, focusOnSelect: true, infinite: false, responsive: [ { breakpoint: 992, settings: { slidesToShow: 3, vertical: false, } }, { breakpoint: 768, settings: { slidesToShow: 2, vertical: false, slidesToScroll: 2, } }, { breakpoint: 480, settings: { slidesToShow: 1, vertical: false, slidesToScroll: 1, } } ] }); $('.main-dt').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, autoplay: true, asNavFor: '.thumb-dt' }); $('.thumb-dt').slick({ slidesToShow: 3, slidesToScroll: 1, asNavFor: '.main-dt', vertical: true, autoplay: true, arrows: false, focusOnSelect: true, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 992, settings: { slidesToShow: 3, vertical: false, } }, { breakpoint: 768, settings: { slidesToShow: 2, vertical: false, slidesToScroll: 2, } }, { breakpoint: 480, settings: { slidesToShow: 1, vertical: false, slidesToScroll: 1, } } ] }); $('.pic-main').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, autoplay: true, asNavFor: '.pic-thumb' }); $('.pic-thumb').slick({ slidesToShow: 5, slidesToScroll: 1, asNavFor: '.pic-main', vertical: true, autoplay: true, arrows: true, focusOnSelect: true, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 992, settings: { slidesToShow: 3, vertical: false, } }, { breakpoint: 768, settings: { slidesToShow: 2, vertical: false, slidesToScroll: 1, } }, { breakpoint: 480, settings: { slidesToShow: 1, vertical: false, slidesToScroll: 1, } } ] }); /** owl carousel **/ $('.news-default').owlCarousel({ margin: 20, loop: true, nav: true, autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 600: { items: 2 }, 1000: { items: 3 } } }); $('.pic-year').owlCarousel({ margin: 0, loop: false, nav: true, autoplay: false, //autoplayTimeout: 5000, //autoplayHoverPause: true, responsive: { 0: { items: 3 }, 480: { items: 5 }, 600: { items: 7 }, 1000: { items: 9 } } }); $('.partner').owlCarousel({ margin: 10, loop: true, nav: false, autoplay: true, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 2 }, 600: { items: 3 }, 1000: { items: 5 } } }); $('.more-news-dt').owlCarousel({ margin: 10, loop: true, nav: false, autoplay: true, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 600: { items: 2 }, 1000: { items: 3 } } }); /** active carousel bootstrap **/ $('.carousel-inner').find('.item').first().addClass('active'); /** activw tab bootstrap **/ $('.tab-project-slide').find('.items-tab').first().addClass('active'); $('.items-tab').click(function () { $('.items-tab').removeClass('active'); $(this).addClass('active'); }); $('.nav-tabs').find('li').first().addClass('active'); $('.pic-year').find('.owl-item').first().find('.li').addClass('active'); $('.pic-year .owl-item .li').click(function () { $('.pic-year .owl-item .li').removeClass('active'); $(this).addClass('active'); }); $('.tab-content').find('.tab-pane').first().addClass('active'); /*** each elements to get max height ***/ //var maxHeight = 0; //$(".art-postcontent .col-md-4 .items, .dich-vu-cate .col-md-4 .thumbnail").each(function () { // if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } //}); //$(".art-postcontent .col-md-4 .items, .dich-vu-cate .col-md-4 .thumbnail").height(maxHeight); } //================== function mymap() { mympp(); var timeout; $(window).resize(function () { clearTimeout(timeout); setTimeout(function () { mympp(); }, 500); }); } function mympp() { $('#mapwrap').remove(); //if ($(window).width() > 768) { $('#mapshow').append('
'); //} } /*=========================================================================*/ /*=========================================================================*/ $(window).scroll(function () { if ($(this).scrollTop() > 138) { $('.header-sub-bot').addClass('header-scroll'); $('.menu-df').addClass('header-scroll'); } else { $('.header-sub-bot').removeClass('header-scroll'); $('.menu-df').removeClass('header-scroll'); } }); /*=========================================================================*/ //================== scroll top $(window).scroll(function () { if ($(this).scrollTop() > 100) { $('.scroll-to-top').fadeIn(); } else { $('.scroll-to-top').fadeOut(); } }); $('.scroll-to-top').on('click', function (e) { e.preventDefault(); $('html, body').animate({ scrollTop: 0 }, 800); return false; }); /*! Fades in page on load */ $(document).ready(function () { $('body').css('display', 'none'); $('body').fadeIn(1000); }); /*! menu-scroll's distribution */ /* thêm */ var hng = $('.list-pro-cate .col-md-4 .item .title > a').outerHeight(); $('.list-pro-cate .col-md-4 .item .title > .read-more').height(hng); /* thêm */ $(document).ready(function () { $(window).resize(function () { $(window).scroll(function () { if ($(this).scrollTop() > 350) { $('.menu-distribution').fadeIn(); } else { $('.menu-distribution').fadeOut(); } }); /* thêm */ var hng = $('.list-pro-cate .col-md-4 .item .title > a').outerHeight(); $('.list-pro-cate .col-md-4 .item .title > .read-more').height(hng); /* thêm */ }).resize(); }); $('.menu-distribution .menu-scroll li:nth-child(1)').on('click', function () { $('html, body').animate({ scrollTop: $('.items-table.first').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(2)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-left .items-table:nth-child(2)').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(3)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-right .items-table:nth-child(1)').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(4)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-right .items-table:nth-child(2)').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(5)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-left .items-table:nth-child(3)').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(6)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-left .items-table:nth-child(4)').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(7)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-left .items-table:nth-child(3)').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(8)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-right .items-table:nth-child(3)').offset().top - 60 }, 1000); }); $('.menu-distribution .menu-scroll li:nth-child(9)').on('click', function () { $('html, body').animate({ scrollTop: $('.list-table .pull-right .items-table:nth-child(1)').offset().top - 60 }, 1000); }); /** popup **/ $('.button-answer img').show(); $('.button-answer img').click(function () { $('#main-content').append('
'); $('.popup-content').css('top', '0'); }); $(document).on('click', ".popup-btn-close, #overlay-screen-active", function () { $('.popup-content').css('top', '-250%'); $('#overlay-screen-active').fadeOut(); $('#overlay-screen-active').remove(); return false; }); $(document).ready(function () { $(window).resize(function () { var winwidth = $(window).width(); if ($(window).width() > 480) { $('.button-answer img').show(); $('.button-answer img').click(function () { $('#main-content').append('
'); $('#overlay-screen-active').remove(); $('.popup-content').css('top', '0'); }); $(document).on('click', ".popup-btn-close, #overlay-screen-active", function () { $('.popup-content').css('top', '-250%'); $('#overlay-screen-active').fadeOut(); $('#overlay-screen-active').remove(); return false; }); } else if ($(window).width() < 480) { $('.button-answer img').hide(); } }).resize(); }); /* product-cate */ $('.products-cate .content > ul > li').children('ul').addClass('first-sub'); $('.products-cate ul.first-sub > li').children('ul').addClass('second-sub'); $('.first-sub').each(function () { var m = $(this).children('li').length; console.log(m); if (m == 0) { var a = $(this).parent('li'); a.children('.first-sub-arraw').remove(); } else { var a = $(this).parent('li'); a.append('
' + '