(function( $ ) { $( document ).on( 'ready', function() { $('.single-post .ticon-facebook').on('click', function(e){ e.preventDefault(); window.open('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.URL)); return false; }) $('.single-post .ticon-linkedin').on('click', function(e){ e.preventDefault(); window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.URL) + '&title=' + encodeURIComponent(document.title)); return false; }) let $links = $('.link-all'); $links.each(function (){ $(this).hover( function() { let line = $(this).closest('.wpb_wrapper').find('.line-animate-horizontal').animate({'width': '110px'},700); }, function() { let line = $(this).closest('.wpb_wrapper').find('.line-animate-horizontal').animate({'width': '0px'},700); } ); }) let $linksGorizontal = $('.vertical-text-triger'); $linksGorizontal.each(function (){ $(this).hover( function() { let line = $(this).find('.line-animate-vertical').animate({'height': '110px'},700); }, function() { let line = $(this).find('.line-animate-vertical').animate({'height': '0px'},700); } ); }) // Show more description About page Our people $('.vcex-image-grid-entry .show-more').on('click',function (){ $(this).siblings('.hidden-content').slideToggle(); }); // Display Slider Home Page if(document.querySelector('.home__slider') !== null) { let slider = $('.slider-entry'); slider.slick({ slidesToShow: 1, slidesToScroll: 1, infinite: false, dots: true, arrows: true, //adaptiveHeight: true, prevArrow: '
', nextArrow: '
', responsive: [ { breakpoint: 768, settings: { slidesToShow: 1, slidesToScroll: 1, } }, ] }); $('.slick-dots li button').on('click', function(e){ e.stopPropagation(); // use this }); // Functional Slider / Arrows slider.find('.slick-arrow').on('click', function (e) { let elem = $(e.target); if(elem.hasClass('next-arrow')) { let prev_arrow = elem.siblings('.prev-arrow'); if(prev_arrow.attr('aria-disabled') === "false") { prev_arrow.addClass('arr-left'); } if(elem.attr('aria-disabled') === "true") { elem.addClass('arr-right-none'); } } else { let next_arrow = elem.siblings('.next-arrow'); if(next_arrow.attr('aria-disabled') === "false") { next_arrow.removeClass('arr-right-none'); } if(elem.attr('aria-disabled') === "true") { elem.removeClass('arr-left'); } } }); // Function dots Slider slider.find('.slick-dots li').on('click', function (e) { let elem = $(e.target); let num = parseInt(elem.find('button').text()); if(num === 2 || num === 3 || num === 4) { elem.parent().siblings(".next-arrow").trigger('click'); elem.parent().siblings(".next-arrow").removeClass('arr-right-none'); } if(num === 5) { elem.parent().siblings(".next-arrow").addClass('arr-right-none'); elem.parent().siblings(".prev-arrow").addClass('arr-left'); } if(num === 1) { elem.parent().siblings(".prev-arrow").removeClass('arr-left'); elem.parent().siblings(".next-arrow").removeClass('arr-right-none'); } }); } // Display Slider News Page if(document.querySelector('.news__slider .featured-entry') !== null) { let slider = $('.featured-entry'); slider.slick({ slidesToShow: 1, slidesToScroll: 1, infinite: true, //centerPadding: '250px', //centerMode: true, dots: true, arrows: false, adaptiveHeight: true, prevArrow: '
', nextArrow: '
', responsive: [ { breakpoint: 1024, settings: { //centerPadding: '0px', centerMode: false, slidesToShow: 1, slidesToScroll: 1, } } ] }); } // Event click link Google Map $(document).on('click','.contact-us__map .offices a', function (e) { e.preventDefault(); let entryid = $(e.target).data('entryid'); initialize( entryid ); }); }); $( window ).on( 'load', function() { if(document.querySelector('.contact-us__header-section') !== null) { $( "#gform_submit_button_1" ).after(function() { return "
"; }); } const options = { root: null, rootMargin: '0px', threshold: 0.9 } //Animate Horizontal Line // const observerHorizontal = new IntersectionObserver((entries, observer) => { // entries.forEach(entry => { // if (entry.isIntersecting) { // $(entry.target).animate({'width': '110px'},700); // observer.unobserve(entry.target); // } // }) // }, options); // // // Animate Vertical Line // const observerVertical = new IntersectionObserver((entries, observer) => { // entries.forEach(entry => { // if (entry.isIntersecting) { // $(entry.target).animate({'height': '110px'},700); // observer.unobserve(entry.target); // } // }) // }, options); // document.querySelectorAll('.line-animate-horizontal').forEach(el => { // observerHorizontal.observe(el); // }); // // document.querySelectorAll('.line-animate-vertical').forEach(el => { // observerVertical.observe(el); // }); }); $( window ).on( 'scroll', function() { // add header background in scroll let header = $('#wrap #site-header') if ($(this).scrollTop() > 70) { header.addClass('active'); } else { header.removeClass('active'); } } ); }( jQuery )); /** * Google Map */ function initialize( entryid ) { let iconBase = _global_object.path; let default_office = JSON.parse(_map_object.default_office); const map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 12, center: new google.maps.LatLng(default_office.lat, default_office.lon), mapTypeId: google.maps.MapTypeId.ROADMAP, }); const infowindow = new google.maps.InfoWindow(); marker = new google.maps.Marker({ position: new google.maps.LatLng(default_office.lat, default_office.lon), map: map, icon : iconBase + "/images/marker.png" }); let content = `

${default_office.city}

${default_office.address}
`; infowindow.setContent(content); infowindow.open(map, marker); var _markers = new Map(); resultHtml =`

Our Offices

`; document.querySelector('.contact-us__map .offices').innerHTML = resultHtml; // if clicked on items menu if( undefined !== entryid ) { _map_object.data_company.forEach(function (el) { let obj = JSON.parse(el); if(parseInt(obj.id) === entryid ) { map.center = new google.maps.LatLng(obj.lat, obj.lon); //map.zoom = 7; let content = `

${obj.company}

${obj.address}
`; infowindow.setContent(content); infowindow.open(map, _markers.get(entryid)); return; } }); } }