$(document).ready(function(){ //$.mobile.pushStateEnabled = false; // $('.ui-loader').hide(); //resizevdo(); // Lang $('.tc-lang').on('click', function () { var loca = document.location.href; if (loca.indexOf("/en/") >= 0) { document.location.href = document.location.href.replace('/en/','/tc/'); }else if (loca.indexOf("/sc/") >= 0) { document.location.href = document.location.href.replace('/sc/','/tc/'); } }); $('.sc-lang').on('click', function () { var loca = document.location.href; if (loca.indexOf("/en/") >= 0) { document.location.href = document.location.href.replace('/en/','/sc/'); }else if (loca.indexOf("/tc/") >= 0) { document.location.href = document.location.href.replace('/tc/','/sc/'); } }); $('.en-lang').on('click', function () { var loca = document.location.href; if (loca.indexOf("/tc/") >= 0) { document.location.href = document.location.href.replace('/tc/','/en/'); }else if (loca.indexOf("/sc/") >= 0) { document.location.href = document.location.href.replace('/sc/','/en/'); } }); //for QR if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { $(".mobileSHOW").show(); $(".desktopSHOW").hide(); }else{ $(".mobileSHOW").hide(); $(".desktopSHOW").show(); } rePositQR(); var menuHeight = $(".desktop-nav").outerHeight(); $('.menu-button').on('click', function () { event.preventDefault(); $(".menu-button").toggleClass('active'); $(".itemside").slideToggle(); //$(".itemside").toggleClass('active'); }); $('.movieList li a').on('click', function () { $('.movieList li a').removeClass('active'); $(this).addClass('active'); if ($(window).width() <= 1024) { $("html, body").animate({ scrollTop: $(".tab-content").offset().top }, 500); } }); $(function(){ $( "video" ).bind( "tap", tapHandler ); function tapHandler( event ){ var playpause = $('#vdo').get(0); if (playpause.paused === false) { playpause.pause(); $('.maskonkv').fadeIn(); } else { playpause.play(); } return false; } }); $('#urlpolicy').on('click', function () { $('#myModal').toggle(); }); $('#myModal').on('click', function () { var target = $( event.target ); if ( target.is( "#myModal" ) ) { $('#myModal').hide(); } }); $(".modal-content .close").on('click', function () { $('#myModal').hide(); }); //load g-maps $("#gooMap").load('googleMap.html'); $('.function_bar').on('click', function(){ $(this).find('.circle-plus').toggleClass('opened'); $(this).parent().find('.function_item').slideToggle(); }); /* === Get the modal pop up START == */ var modal = document.getElementById('myModal'); var span = document.getElementsByClassName("close")[0]; $('.urlpolicy').on('click', function () { modal.style.display = "block"; }); span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } //debug click check // $('body').click(function(e) { // var target = $(event.target); // console.log(target); // }); //20200915 - floating CTA $('#downBTN').on('click', function () { event.preventDefault(); if($(window).width() >= 768) { $("#QR_contain").css('display','block'); }else{ //check href to switch path language if (window.location.href.indexOf("/en") > -1) { window.location.href = 'http://pzm.me/inmotion_1888_en';l }else if (window.location.href.indexOf("/tc") > -1){ window.location.href = 'http://pzm.me/inmotion_1888'; }else if (window.location.href.indexOf("/sc") > -1){ window.location.href = 'http://pzm.me/inmotion_1888_sc'; } } }); $('#QR_contain').on('click', function () { event.preventDefault(); $('#QR_contain').hide(); }); $(window).scroll(function() { if($(window).scrollTop() > 150) { $('#floatAPPLY').addClass('scrolled'); }else{ $('#floatAPPLY').removeClass('scrolled'); } }); }); $( window ).resize(function() { //resizevdo(); rePositQR(); if ($(window).width() > 1024) { $(".itemside").css('display','inline-block'); }else{ $(".itemside").css('display','none'); } }); function resizevdo(){ var vdowidth = $(window).width(); if ($(window).width() < 768) { $('video').height($(document).width()); } } function rePositQR(){ if ($(window).width() >= 1024) { $( ".downloadBOX" ).mouseover(function() { $(this).next('.app-qrbox').addClass('qrshow'); var widthDownloadnow = $(this).outerWidth(); var widthAppqr = $('.app_qr').outerWidth(); //console.log(widthDownloadnow,widthAppqr); var appQRLeft = (widthDownloadnow/2) - (widthAppqr/2); $('.app-qrbox').css('margin-left',appQRLeft); }); $( ".downloadBOX" ).mouseout(function() { $(this).next('.app-qrbox').removeClass('qrshow'); }); $('.downloadBOX').removeAttr("href"); } else { $('.downloadBOX').attr(''); } } function closeFancy(){ $.fancybox.close(); } // Batch 5 START $(document).ready(function() { $("#urlpolicy").on("click", function (e) { $("a:not(.modal-content a), button, ipnut, textarea, select").addClass("tabindexNum").attr("tabindex", -1); $(".modal-content a, #myModal:not(.modal-content)").click(function () { e.target.focus(); $(".tabindexNum").removeClass("tabindexNum").removeAttr("tabindex"); }) }) }) // Batch 5 END