"; $("body").append(sTemp); $("#copyurl").select(); document.execCommand("copy"); $("#copyurl").remove(); alert(sURL + '已成功複製,歡迎您分享!');}$(function () { $(window).scroll(function () { var scrollVal = $(this).scrollTop(); if(scrollVal < 150){ $("#article_conshare").hide(); }else if(scrollVal > 150){ $("#article_conshare").show(); } });});var recaptcha1;var recaptcha2;var recaptcha3;var recaptcha4;var recaptcha5;var recaptcha_login;var recaptcha_pc;var recaptcha_mob;var myCallBack = function() { $('body').find('#recaptcha1').each(function(KEY){ if(KEY == 0){ recaptcha1 = grecaptcha.render('recaptcha1', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light' }); } }); $('body').find('#recaptcha2').each(function(KEY){ if(KEY == 0){ recaptcha2 = grecaptcha.render('recaptcha2', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light' }); } }); $('body').find('#recaptcha3').each(function(KEY){ if(KEY == 0){ recaptcha3 = grecaptcha.render('recaptcha3', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light' }); } }); $('body').find('#recaptcha4').each(function(KEY){ if(KEY == 0){ recaptcha4 = grecaptcha.render('recaptcha4', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light' }); } }); $('body').find('#recaptcha5').each(function(KEY){ if(KEY == 0){ recaptcha5 = grecaptcha.render('recaptcha5', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light' }); } }); $('body').find('#recaptcha_login').each(function(KEY){ if(KEY == 0){ recaptcha_login = grecaptcha.render('recaptcha_login', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light' }); } }); $('body').find('#recaptcha_pc').each(function(KEY){ if(KEY == 0){ recaptcha_pc = grecaptcha.render('recaptcha_pc', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light', }); } }); $('body').find('#recaptcha_mob').each(function(KEY){ if(KEY == 0){ recaptcha_mob = grecaptcha.render('recaptcha_mob', { 'sitekey' : '6LfWCUMUAAAAADLQqBUGwKpDQh6F17Ew2xAMrnKj', 'theme' : 'light', }); } });};function add_cart_new(layout_type,is_msg,pay_type, product_id, category_id, spec_id){ $.ajax({ type: "POST", url: "/ajax_cart/get_amount", data: 'product_id='+product_id, dataType:'json', success: function(info) { if(info.result){ if(parseInt(info.amount) < 10){ amount = parseInt(info.amount)+1; }else{ parseInt(info.amount)+1; } } if(amount > 0) { ajax_add_cart(1, 0, category_id, product_id, spec_id, amount, is_msg, pay_type); fb_marketing_event('AddToCart',{"content_ids":["246"],"content_type":"product","value":"890","currency":"TWD"}); } else { alert('請選擇數量'); } return(false); } });}function gotop(){ $("html,body").animate({ scrollTop: 0 }, 900); return false;}function seecar(){ alert('您尚未選購商品');}function update_see(id){ $.ajax({ type: "POST", url: "/ajax_website/update_see", data: {'id' : id}, dataType:'json', success: function(info) { console.log(info); } });}$(function() { /* 登入 */ $('#sign_in_block').hide(); $('.sign_in_btn, #btn_g_sty').click(function() { $('#sign_in_block').show(); $('#sign_in_block').css('display', 'block'); $('.cart_btn').removeClass('active'); }); $('.sign_in_hide').click(function() { $('#sign_in_block').hide(); $('#sign_in_block').css('display', 'none'); $('.show_sign_in').fadeIn(); $('.show_forget_psw').fadeOut(); }); /* 登出 */ $('#sign_out').click(function() { alert("成功登出"); }); /* 忘記密碼燈箱 */ $('.forget_psw_btn').click(function(){ $('.show_sign_in').fadeToggle(); $('.show_forget_psw').fadeToggle(); }); /* 註冊 */ var cart_num = parseInt($("#cart_num").text()); if (cart_num <= 0) { $('.sign_prompt_n').show(); $('.sign_prompt_y').hide(); } else { $('.sign_prompt_y').show(); $('.sign_prompt_n').hide(); } /* 購物車區塊 */ $('.cart_btn').hover( function() { $('.cart_btn').addClass('active'); }, function() { $('.cart_btn').removeClass('active'); } ); $('#continue_shopping').click(function() { $('.cart_btn').removeClass('active'); }); $('#cart_mobile_link').click(function(e) { if($('span.cart_num').text() == 0) { e.preventDefault(); alert('您尚未選購產品'); } }); /*表單驗證*/ $('#validation-login-form').validate({ errorElement: 'label', errorClass: 'error', focusInvalid: false, ignore: '', rules: { account: { required: true }, password: { required: true }, captcha: { required: true } }, 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.parent()); }, submitHandler: function(form) { loginbyGeneral(form, 'pc'); } }); $('.validation-login-form').validate({ errorElement: 'label', errorClass: 'error', focusInvalid: false, ignore: '', rules: { account: { required: true }, password: { required: true }, captcha: { required: true } }, 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.parent()); }, submitHandler: function(form) { loginbyGeneral(form, 'pc'); } }); $('.validation-login-form2').validate({ errorElement: 'label', errorClass: 'error', focusInvalid: false, ignore: '', rules: { account: { required: true }, password: { required: true }, captcha: { required: true } }, 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.parent()); }, submitHandler: function(form) { loginbyGeneral(form, 'pc'); } }); $('#location-search-form').validate({ errorElement: 'label', errorClass: 'error', focusInvalid: false, ignore: '', rules: { }, errorPlacement: function(error, element) { error.insertAfter(element); }, submitHandler: function(form) {$('body').append($('
').attr({'id':'hide_box'}).append($('').text('查詢中')));form.submit(); } });});function search_check(obj, e) { if ($(obj).find('input[name="search_val"]').val().length == 0) { alert('請輸入查詢之關鍵字'); e.preventDefault(); }}$(function () { $('#home_slider').flexslider({ animation : 'slide', controlNav : true, directionNav : false, animationLoop : true, slideshow : true, pauseOnHover:true, useCSS : false });});$(function () { $('.flexslider').flexslider({ animation : 'slide', controlNav : true, directionNav : true, animationLoop : true, slideshow : true, pauseOnHover:true, useCSS : false });}); /*var $down = $('.sj-aq-dibu'); var $window = $(window); var $document = $(document); $window.scroll(function(){ if ($document.scrollTop() + $window.height()+700 >= $document.height()) { $down.hide(); $(".aqindex_footer").css("margin-bottom",'0px'); } else { $down.show(); $(".aqindex_footer").css("margin-bottom",'50px'); } });*/ $(function () { $('#home_slider22').flexslider({ animation : 'slide', controlNav : false, directionNav : true, animationLoop : true, slideshow : true, pauseOnHover:true, useCSS : false, maxItems:5 }); $('#home_slider33').flexslider({ animation : 'slide', controlNav : false, directionNav : true, animationLoop : true, slideshow : true, pauseOnHover:true, useCSS : false }); }); var show_num = 0; var show_b=0; if($(window).width() < 1200&&$(window).width() >991) { show_num = 3; show_b=20; }else if($(window).width() < 992&&$(window).width() >767){ show_num = 2; show_b=20; } else if($(window).width() <768){ show_num = 1; show_b=40; } else { show_num = 4; show_b=20; } var swiper_discuss = new Swiper('.indexnews_discuss_swiper .swiper-container', { slidesPerView: show_num, spaceBetween: show_b, loop:true, navigation: { nextEl: '.indexnews_discuss_swiper .swiper-button-next', prevEl: '.indexnews_discuss_swiper .swiper-button-prev', }, pagination: { el: '.indexnews_discuss_swiper .swiper-pagination', clickable: true, }, }); var swiper_trait = new Swiper('.indexnews_trait_swiper .swiper-container', { slidesPerView:1, spaceBetween: 0, loop:true, navigation: { nextEl: '.indexnews_trait_swiper .swiper-button-next', prevEl: '.indexnews_trait_swiper .swiper-button-prev', }, pagination: { el: '.indexnews_trait_swiper .swiper-pagination', clickable: true, }, }); var swiper_about = new Swiper('.indexnews_swiper_about .swiper-container', { slidesPerView:1, spaceBetween: 0, loop:true, navigation: { nextEl: '.indexnews_swiper_about .swiper-button-next', prevEl: '.indexnews_swiper_about .swiper-button-prev', }, }); var swiper_newsindex = new Swiper('.newsindex_banner .swiper-container', { slidesPerView:1, spaceBetween: 0, loop:true, autoplay: { delay: 2500, disableOnInteraction: false, }, pagination: { el: '.newsindex_banner .swiper-pagination', clickable: true, }, }); var swiper = new Swiper('.q_dra_service_good_sj .swiper-container', { slidesPerView: 2, spaceBetween: 15, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, pagination: { el: '.swiper-pagination', clickable: true, }, }); $(".footer-top-title").click(function(){ $(this).toggleClass("footer-top-title-hover"); $(this).next(".footer-top-none").slideToggle(); });$(".head-level-title").click(function(){$(this).toggleClass("head-level-title-active");$(this).next(".head-level-link").slideToggle();});$("#product-add").click(function() {var t = $('#alert-amount');if(parseInt(t.val()) + 1 <= max_stock) {t.val(parseInt(t.val()) + 1);}});$("#product-min").click(function() {var t = $('#alert-amount');if(parseInt(t.val())- 1 < 1){t.val(1);}else{t.val(parseInt(t.val()) - 1);}});$(".alert-cart-add-color").change(function(){$('.alert-add-cart-amount').val(1);$("#spec_detail_id").val($(this).val());$.ajax({type : 'post',url : '/ajax_website/get_size_carousel',data : {'product_spec_detail_id' : $(this).val(),},dataType : 'json',success : function (info) {$('.alert-cart-add-size').html(info.size_optoin);},error : function () {alert('網路錯誤');}});});$(".alert-cart-add-size").change(function(){$('.alert-add-cart-amount').val(1);$("#spec_size_id").val($(this).val());$.ajax({type : 'post',url : '/ajax_website/get_size_num',data : {'spec_size_id' : $(this).val(),},dataType : 'json',success : function (info) {if(info.result){max_stock = info.stock;}},error : function () {alert('網路錯誤');}});});/*會員中心收縮*/$(".member-menu-top").click(function(){$(this).toggleClass("member-menu-top-active");$(this).next(".member-menu-bottom").slideToggle();});$(".member-menu-group-title").click(function(){$(this).toggleClass("member-menu-group-title-active");$(this).next(".member-menu-group-bottom").slideToggle();});/*新menu*/$(".phone-toggle").click(function(){$(this).toggleClass("phone-toggle-active");$(this).parents(".new_sj_menu_yin_rt_tl").next(".new_sj_menu_yin_rt_a").slideToggle();});$(".menu-left-item p").hover(function(){var index = $(this).index();$(this).addClass('active').siblings().removeClass('active');$(this).parents(".menu-left-item").next(".menu-right-item").find(".menu-right-main").eq(index).show().addClass('active').siblings().removeClass('active').hide();});/* 搜尋關鍵字送出 */function search_keyword(topic) {$('#formkeyta_mobile').find('input[name=search_type]').val('keyword');$('#formkeyta_mobile .new_sj_ss_main_inp').find('input[name=search_val]').val(topic);$('#formkeyta_mobile').submit();}