"; $("body").append(sTemp); $("#copyurl").select(); document.execCommand("copy"); $("#copyurl").remove(); swal('此篇課程連結已成功複製,歡迎您分享!'); } $(function () { $(window).scroll(function () { var scrollVal = $(this).scrollTop(); if(scrollVal < 150){ $("#article_conshare").hide(); }else if(scrollVal > 150){ $("#article_conshare").show(); } }); $("input[name=select_designer]:first").prop("checked",true); }); function choiceAll(id) { $(".ckbox_data" + id).each(function() { $(this).prop('checked', true); }); } function cancelAll(id) { $(".ckbox_data" + id).each(function() { $(this).prop('checked', false); }); } /* var rad = document.myForm.industry_engaged; var prev = null; for (var i = 0; i < rad.length; i++) { rad[i].addEventListener('change', function() { (prev) ? console.log(prev.value): null; if (this !== prev) { prev = this; } console.log(this.value); if(this.value == 19){ $("#otherInput").show(); }else{ $("#otherInput").hide(); } }); }*/ $(".ai-support-group-title").click(function () { $(this).toggleClass("ai-support-group-titles"); $(this).next(".ai-support-group-text").slideToggle(); $(this).parents(".ai-support-groups").toggleClass("ai-support-group-hover") });$(".sign-up-button").click(function () {$('html, body').animate({scrollTop: $('.service-form').offset().top - 100}, 1000);}); var swiper = new Swiper('.ai-video-phone .swiper-container', { slidesPerView: 1, spaceBetween: 0, loop: true, navigation: { nextEl: '.ai-video-phone .swiper-button-next', prevEl: '.ai-video-phone .swiper-button-prev', }, pagination: { el: '.ai-video-phone .swiper-pagination', clickable: true, }, }); var show_num = 0; var show_b = 0; if ($(window).width() < 767) { show_num = 1; show_b = 0; } else { show_num = 3; show_b = 35; } var swiper = new Swiper('.ai-competition-banners .swiper-container', { slidesPerView: show_num, spaceBetween: show_b, loop: true, navigation: { nextEl: '.ai-competition-banners .swiper-button-next', prevEl: '.ai-competition-banners .swiper-button-prev', }, pagination: { el: '.ai-competition-banners .swiper-pagination', clickable: true, }, });$("#final_payment_method").change(function(){if($(this).val() == '零卡分期'){$('.none_card_text').show();}else{$('.none_card_text').hide();}}); $(function () { get_time_option($("#reservation_time"), 11,19,30,'請選擇預約時間'); get_time_option($("#contact_time_start"), 10,24,60,'請選擇聯絡時間');var disabledDates = ["2022-02-01","2022-02-02","2022-02-03","2022-02-04"]; $("#reservation_date").datepicker({ dateFormat: "yy/mm/dd", minDate: '+3D', onSelect: function(dateText) { if(dateText == $.datepicker.formatDate('yy/mm/dd', new Date())){ let min = new Date().getHours()+1; get_time_option($("#reservation_time"), min,19,30, '請選擇預約時間'); } },beforeShowDay: function(date){var string = jQuery.datepicker.formatDate('yy-mm-dd', date);return [ disabledDates.indexOf(string) == -1 ];} }); $('#contact_time_end').prop('disabled', true); $("#contact_time_start").change(function(){ let start_time = $(this).val().split(":",2)[0]; get_time_option($("#contact_time_end"), parseInt(start_time)+1, 24, 60,'請選擇聯絡時間'); $('#contact_time_end').prop('disabled', false); }); $("#reservation_time option[value='11:00']").each(function() { $(this).remove(); }); $('#validation-service-form').validate({ errorElement: 'label', errorClass: 'error', focusInvalid: false, ignore: '', focusInvalid: false, invalidHandler: function (form, validator) { if (!validator.numberOfInvalids()) return; $('html, body').animate({ scrollTop: $(validator.errorList[0].element).offset().top - 100 }, 1000); }, rules: { ckbox_data: { required: true, }, last_name: { required: true, }, first_name: { required: true, }, email: { required: true, email: true }, mobile: { required: true, digits: true, mobileTaiwan: true, maxlength: 10, minlength: 10, }, select_designer: { required: true, }, account_last_five_digits: { required: true, maxlength: 5, minlength:5, }, reservation_item: { required: true, }, reservation_date: { required: true, }, reservation_time: { required: true, }, contact_time_start: { required: true, }, contact_time_end: { required: true, },trans_bank:{required: true,digits: true,maxlength: 3,minlength: 3,},trans_5_code:{required: true,digits: true,maxlength: 5,minlength: 5,},final_payment_method: { required: true, }, }, messages:{ account_last_five_digits: { minlength:'請填五個數字' } },errorPlacement: function (error, element) {if(element.is('input[type=checkbox]') || element.is('input[type=radio]')) {var controls = element.closest('div[class*="col-"]');if(controls.find(':checkbox,:radio').length > 1) controls.append(error);else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));}else error.insertAfter(element);}, submitHandler: function (form) { if (typeof (grecaptcha) == 'object' && grecaptcha.getResponse(recaptcha3) == '') { alert('請勾選我不是機器人'); return false; } /*惡意文字偵測*/ var content = $('textarea#content').val(); if (content != "") { $.ajax({ 'type': 'post', 'url': '/ajax_website/ck_ban_text', 'data': { 'content': content }, 'dataType': 'json', 'success': function (info) { if (info.result == "yes") { alert("[留言內容]文字內包含非法文字"); return false; } else { $('#send').attr('disabled', 'disabled'); $('body') .append( $('
') .attr({ 'id': 'hide_box' }) .append( $('') .text('送出中') ) ); form.submit(); } } }); } else { $('#send').attr('disabled', 'disabled'); $('body') .append( $('') .attr({ 'id': 'hide_box' }) .append( $('') .text('送出中') ) ); form.submit(); } } }); }); $(document).scroll(function() { var obody=$(window).scrollTop(); if(obody>0){ $('.head-times').addClass("head-times-fix"); } else{ $('.head-times').removeClass("head-times-fix"); } }); $(".gps-list-title").click(function(){ $(this).toggleClass("gps-list-title-hover"); $(this).next(".gps-list-none").slideToggle(); });