$(function() { var window_width = $( window ).width(); var interval; var width = 0; var step = 2; $(".list-box").hover( function() { //$(this).find(".pkg-image").css("visibility", "hidden"); width = 1; var sample_top = $(this).find(".bthumb-sample-top"); sample_top.css("visibility", "visible"); interval = setInterval(function() { if (width >= 100) { sample_top.css("width", '0%'); clearInterval(interval); } else { width = width + step; sample_top.css("width", width + '%'); } }, 15); $(this).find(".bthumb-sample").css("visibility", "visible"); var video_obj = $(this).find("video").get(0); if (video_obj !== undefined && video_obj !== null) { video_obj.play(); } }, function() { //$(this).find(".pkg-image").css("visibility", "visible"); $(this).find(".bthumb-sample-top").css("visibility", "hidden"); $(this).find(".bthumb-sample-top").css("width", "0%"); clearInterval(interval); $(this).find(".bthumb-sample").css("visibility", "hidden"); var video_obj = $(this).find("video").get(0); if (video_obj !== undefined && video_obj !== null) { video_obj.pause(); video_obj.currentTime = 0; } } ); if(window_width <= '992') { $(".list-box a").click(function(e) { var click_count = $(this).attr('data-count'); if(click_count == '0') { e.preventDefault(); width = 1; var sample_top = $(this).parent().find(".bthumb-sample-top"); sample_top.css("visibility", "visible"); interval = setInterval(function() { if (width >= 100) { sample_top.css("width", '0%'); clearInterval(interval); } else { width = width + step; sample_top.css("width", width + '%'); } }, 15); $(this).parent().find(".bthumb-sample").css("visibility", "visible"); var video_obj = $(this).parent().find("video").get(0); if (video_obj !== undefined && video_obj !== null) { video_obj.play(); } $(this).attr('data-count', '1'); } }); } $('.dvd_b-link4 a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500,'easeInOutExpo'); /* if you don't want to use the easing effects: $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1000); */ event.preventDefault(); }); $('.dvd_b-link a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500,'easeInOutExpo'); /* if you don't want to use the easing effects: $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1000); */ event.preventDefault(); }); $('a.animation').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500,'easeInOutExpo'); /* if you don't want to use the easing effects: $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1000); */ event.preventDefault(); }); $(".home-category-list-open").click(function(e){ e.preventDefault(); home_category_list('open'); }); $(".home-category-list-close").click(function(e){ e.preventDefault(); home_category_list('close'); }); category_timeout = setTimeout(function() { home_category_list('close'); }, 10000); var homeTabLength = $(".home-tabs li").length; var homeTabIndex = Math.floor(Math.random() * homeTabLength); home_tabs($(".home-tabs li").eq(homeTabIndex).find("a")); $(".home-tablink").click(function(e){ home_tabs(this); e.preventDefault(); return false; }); $(".faq_wrap").each(function() { if(window_width > '992') { $(this).attr('data-height', $(this).height()); $(this).css('height', '0px'); } }); $(".faq-list-open").click(function(e){ e.preventDefault(); var ele_height = $(this).parent().next(".faq_wrap").attr('data-height'); $(this).parent().next(".faq_wrap").animate({ height: ele_height + 'px' }, 1200, 'swing'); }); $(".faq-list-close").click(function(e){ e.preventDefault(); $(this).parent().next(".faq_wrap").animate({ height: '0px' }, 1200, 'swing'); }); $("#mobile-menu-bar").on("click", function() { $(".header__nav").toggle("slow"); }); $(".header__nav_mobile_close a").on("click", function(e) { e.preventDefault(); $(".header__nav").toggle("slow"); }); /* $(".header__list-link-dropdown > a").on("click", function(e) { e.preventDefault(); var width = $( window ).width(); if(window_width <= '992') { $(this).parent().find(".header__list").toggle("display "); } }); */ $(".header__list-link-dropdown").each(function() { if(window_width <= '992') { $(this).find(".header__list").show(); } }); /* Category Page */ $("input[name='category_page_pkg_type'][value='some dl']").prop("checked",true); $("input[name='category_page_pkg_type']").click(function() { var pkg_type = $(this).val(); $(".category-page-list .glow-on-hover-4").each(function() { var url = $(this).attr('data-' + pkg_type); $(this).find("a").attr("href", url); }); }); /* Keyword Page */ $("input[name='keyword_page_pkg_type'][value='some dl']").prop("checked",true); $("input[name='keyword_page_pkg_type']").click(function() { var pkg_type = $(this).val(); $(".keyword-page-list .glow-on-hover-3b").each(function() { var url = $(this).attr('data-' + pkg_type); $(this).find("a").attr("href", url); }); }); /* 2024-04 Golden week Promotion */ var pre_promotion_count_down_date = new Date("2024-04-28 10:00:00").getTime(); var now = new Date().getTime(); var distance = pre_promotion_count_down_date - now; var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Display the result in the element with id="demo" $(".pre-promotion").html(days + "日 " + hours + ":" + minutes + ":" + seconds); var pre_promotion_count_down_setInterval = setInterval(function() { var now = new Date().getTime(); var distance = pre_promotion_count_down_date - now; var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Display the result in the element with id="demo" $(".pre-promotion").html(days + "日 " + hours + ":" + minutes + ":" + seconds); // If the count down is finished, write some text if (distance < 0) { clearInterval(pre_promotion_count_down_setInterval); $(".pre-promotion").html(); } }, 1000); var on_promotion_count_down_date = new Date("2024-05-04 23:59:59").getTime(); var now = new Date().getTime(); var distance = on_promotion_count_down_date - now; var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Display the result in the element with id="demo" $(".in-promotion").html(days + "日 " + hours + ":" + minutes + ":" + seconds); var on_promotion_count_down_setInterval = setInterval(function() { var now = new Date().getTime(); var distance = on_promotion_count_down_date - now; var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Display the result in the element with id="demo" $(".in-promotion").html(days + "日 " + hours + ":" + minutes + ":" + seconds); // If the count down is finished, write some text if (distance < 0) { clearInterval(on_promotion_count_down_setInterval); $(".in-promotion").html(); } }, 1000); }); function home_tabs(obj) { var target = $(obj).attr('data-tab'); $(".home-tablink").removeClass('active'); $(obj).addClass('active'); $(".home-tabcontent").hide(); $("#"+target).show(); } function home_category_list(action = '') { clearTimeout(category_timeout); if(action == '') { action = $(".home-category-list").val('data-status'); if(action == 'open') { action = 'close'; } else { action = 'open'; } } if(action == 'open') { $(".home-category-list-inner").animate({ height: '510px' }, 1200, 'swing'); $(".home-category-list").attr('data-status', 'open'); } else if(action == 'close') { $(".home-category-list-inner").animate({ height: '0px' }, 1200, 'swing'); $(".home-category-list").attr('data-status', 'close'); } }