1/*! 2 * Chieh-Han Chang v20220408 3 * Copyright 2019-2022 4 * Licensed under Tonghe 2022 Tonghe Marketing Co.,Ltd . 5 */ 6 7 8var whois = "We Are éåè¡é·ï¼" 9 10//ç¶åè¦çªå¯¬åº¦çºwdth 11wdth = $(window).width() 12 13//è¨å®é¿æå¼æ·é» 14function getScrollbarWidth() { 15 return window.innerWidth - document.documentElement.clientWidth; 16} 17mediawdth_desktop = 1270 - getScrollbarWidth() 18mediawdth_tablet = 768 - getScrollbarWidth() 19 20if (wdth < mediawdth_desktop) { 21 screenmode = 2 22} else { 23 screenmode = 0 24} 25 26$(document).ready(function() { 27 28 // Run after webpage load finished 29 searchbar() 30 menutogglecontrol() 31 Navbartoggle() 32 Swiper_initial() 33 copyrightYear() //çæ¬å¹´ä»½èªåå¡«å ¥ 34 safariHacks() //è§£æ±ºææ©çsafari & chrome å¨100vhæå å«ç¶²ååçåé¡ 35 sociallinkAnimation() //footer sociallinkæé hoveråç« 36 productboxControl() 37 NavbarStyle() //æ´ånavbar卿²åä¸å®è·é¢æçµ¦äºç¹å¥æ¨£å¼ 38 navheadStyleControl() //ç¶åé .navheadè®è² 39 specboxControl() //é»æé¸æè¦æ ¼ 40 dropdownControl() //dropdownéç¨å±é縮å 41 Tenpercentile() //使ç¨.js-Tenpercentileçæ¬ä½æèªåååä½èç 42 // reload when window resizes through the breakpoints 43 // WebReload([mediawdth_tablet, mediawdth_desktop]) 44 SidecaseWithBacktotop() 45 tabboxControl() 46 removeEmptyParagraphs() //ç§»é¤å å«ä¸å<br>ç p æ¨ç±¤ï¼Quillèªå·±ç¢ç 47 // niceScroll_initial() 48 policyblock() 49 mMenuToggle() //shareé çææ©çé¸å®å±é縮å 50 51 // Custom element setting 52 // style_checkbox(); 53 checkboxGiveId() 54 radioGiveId() 55 style_select_init() //custom select style 56 editorStyleAdjust() //編輯å¨å §æ¨£å¼èª¿æ´ 57 58 // For RWD JS running & specific page JS running 59 RUNFUNCRWD() 60 JSPAGEcontrol() //note:run only once 61 62 63 64}) 65 66$(window).resize(function() { 67 wdth = $(window).width() 68 RUNFUNCRWD() 69}) 70 71function WebReload(reloadpoints) { 72 var firstwdth = $(window).width() 73 reloadpoints.forEach(function(breakpoint) { 74 $(window).resize(function() { 75 if (firstwdth >= breakpoint) { 76 // console.log(breakpoint) 77 $(window).width() <= breakpoint ? location.reload() : '' 78 } else { 79 $(window).width() > breakpoint ? location.reload() : '' 80 } 81 }) 82 }) 83} 84 85//RUN func() when switch to desktop or mobile device 86//screenmode=0代表已調æ´çºææ©ç =1代表已調æ´çºå¹³æ¿ç =2代表已調æ´çºé»è ¦ç 87function RUNFUNCRWD() { 88 if (wdth < mediawdth_tablet) { 89 if (screenmode != 0) { 90 screenheight = $(window).innerHeight() 91 92 //èª¿æ´æææ©çå¾è¦runçfunc 93 94 $(".opentoggle").siblings("ul").slideUp() 95 96 97 screenmode = 0 98 console.log("JSç¨å¼-å·²å·è¡éè¡ææ©ç") 99 } 100 } else if (wdth < mediawdth_desktop) { 101 if (screenmode != 1) { 102 screenheight = $(window).innerHeight() 103 104 //èª¿æ´æå¹³æ¿çå¾è¦runçfunc 105 106 $(".opentoggle").siblings("ul").slideUp() 107 108 109 screenmode = 1 110 console.log("JSç¨å¼-å·²å·è¡éè¡å¹³æ¿ç") 111 } 112 } else { 113 if (screenmode != 2) { 114 screenheight = $(window).innerHeight() 115 116 //èª¿æ´æé»è ¦çå¾è¦runçfunc 117 $(".opentoggle").siblings("ul").show() 118 $(".navitem-group").removeClass("js-navitem-group--open") 119 $(".screenmask").removeClass("screenmask--active") 120 $(".wrapper-searchwindow").removeClass("is-softshow") 121 $(".menu-toggle").find("span").removeClass("menu-toggle__span--active") 122 $(".navhead ul").removeClass("h100") 123 $(".navhead-a-active").removeClass("navhead-a-active") 124 $(".sticker-triangle-active").removeClass("sticker-triangle-active") 125 126 screenmode = 2 127 console.log("JSç¨å¼-å·²å·è¡éè¡é»è ¦ç") 128 } 129 } 130} 131 132function JSPAGEcontrol() { 133 //å¨index.htmlæå·è¡ 134 if ($currentpage == "INDEX") { 135 newsbarControl() //æ¶æ¯è·³å 136 Tenpercentile_productbox() //productbox广 ¼èççºååä½ 137 } 138 139 if ($currentpage == "PRODUCTS" || $currentpage == "SEARCH") { 140 Tenpercentile_productbox() //productbox广 ¼èççºååä½ 141 } 142 143 if ($currentpage == "DISCOUNT" || $currentpage == "GUIDELINE") { 144 145 Tenpercentile_productbox() 146 discountboxShow() //discount.html 裡.discountboxåºç¾çåç«
147 discountboxTimeCounting() //å³å°çµæåé 裡ç.discountboxåæ¸è¨æ 148 } 149 150 if ($currentpage == "COUPON") { 151 152 tipwindowControl() 153 } 154 155 if ($currentpage == "ACCOUNT") { 156 157 tipwindowControl() 158 smallwindowControl() 159 } 160 161 if ($currentpage == "PRODUCTSDETAIL") { 162 choosewindowControl() 163 } 164 165 if ($currentpage == "DISCOUNTDETAIL") { 166 Tenpercentile_productbox() 167 smallwindowControl() 168 choosewindowControl() 169 blockReadyaddControl() //æéå¾ å å ¥è³¼ç©è»æ¸ å®çæ§å¶ 170 171 let sidecaseControl = () => { 172 //ææ©çé±è#sidecase 173 if (wdth < mediawdth_tablet) { 174 $('#sidecase').hide() 175 } else { 176 $('#sidecase').show() 177 } 178 } 179 sidecaseControl() 180 181 $(window).resize(function() { 182 sidecaseControl() 183 }) 184 185 } 186 187 if ($currentpage == "ABOUT") { 188 ScrollReachRun($('.block-about-context__right'), 200, 200, false, function() { 189 var timediff = 300 190 $('.aboutbanner').addClass('js-aboutbanner--active') 191 $('.box').each(function() { 192 setTimeout(() => { 193 $(this).addClass('fadeInUp animated') 194 }, timediff += 500) 195 }) 196 }) 197 } 198 199 if ($currentpage == "PRODUCTSDETAIL") { 200 201 } 202 203 if ($currentpage == "NEWS") { 204 205 timestampToDate() 206 } 207 208 if ($currentpage == "ALBUM") { 209 timestampToDate() 210 } 211 212 if ($currentpage == "SITEMAP") { 213 var timediff = 200 214 $('.smbox-group__column').each(function() { 215 setTimeout(() => { 216 $(this).addClass('fadeInUp slower animated') 217 }, timediff += 300) 218 }) 219 } 220 221 222} 223 224// new WOW().init(); 225// wow = new WOW({ 226// boxClass: "wow", // default 227// animateClass: "animated", // default 228// offset: 160, // default 229// mobile: true, // default 230// live: true, // default 231// }) 232// wow.init() 233 234setTimeout(() => { 235 AOS.init({ 236 // Global settings: 237 // disable: function() { 238 // return window.innerWidth < mediawdth_tablet; 239 // }, 240 startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on 241 initClassName: 'aos-init', // class applied after initialization 242 animatedClassName: 'aos-animate', // class applied on animation 243 useClassNames: false, // if true, will add content of `data-aos` as classes on scroll 244 disableMutationObserver: false, // disables automatic mutations' detections (advanced) 245 debounceDelay: 50, // the delay on debounce used while resizing window (advanced) 246 throttleDelay: 99, // the delay on throttle used while scrolling the page (advanced) 247 248 249 // Settings that can be overridden on per-element basis, by `data-aos-*` attributes: 250 offset: 40, // offset (in px) from the original trigger point 251 delay: 0, // values from 0 to 3000, with step 50ms 252 duration: 1000, // values from 0 to 3000, with step 50ms 253 easing: 'ease', // default easing for AOS animations 254 once: true, // whether animation should happen only once - while scrolling down 255 mirror: false, // whether elements should animate out while scrolling past them 256 anchorPlacement: 'top-bottom', // defines which position of the element regarding to window should trigger the animation 257 258 }); 259}, 1000); 260 261// 黿hamburger barå¾ 262function menutogglecontrol() { 263 $(".menu-toggle").click(function() { 264 console.log("é»äºmenu-toggle") 265 $(".navitem-group").toggleClass("js-navitem-group--open") 266 $(this).find("span").toggleClass("menu-toggle__span--active") 267 268 // $header.removeClass("topbar--mobile-shrink"); 269 270 if ($(".navitem-group").hasClass("js-navitem-group--open")) { 271 $(".screenmask").addClass("screenmask--active") 272 } else if ($(".wrapper-searchwindow").hasClass("is-softshow")) {} else { 273 $(".screenmask").removeClass("screenmask--active") 274 } 275 }) 276 $(".screenmask").click(function() { 277 $(this).removeClass("screenmask--active") 278 $(".navitem-group").removeClass("js-navitem-group--open") 279 $(".menu-toggle").find("span").removeClass("menu-toggle__span--active") 280 $(".wrapper-searchwindow").removeClass("is-softshow") 281 }) 282} 283 284//Navbar 次é¸å®opentoggle 285function Navbartoggle() {
286 $(".opentoggle").click(function() { 287 if (wdth < mediawdth_desktop) { 288 // å±éé»ç該層 289 // $(this).siblings('ul').toggleClass('h100'); 290 $(this).siblings("ul").slideToggle() 291 292 // å ç§»é¤å ¶ä»å±¤ç"æ¿æ´»"æ¨£å¼ 293 // $(this).parent().siblings('li').find('ul').removeClass('h100'); 294 $(this).parent().siblings("li").find("ul").slideUp() 295 $(this).parent().siblings("li").removeClass("navhead-active") 296 $(this).parent().siblings("li").find('.sticker-triangle').removeClass("sticker-triangle-active") 297 $(this).parent().siblings("li").find('a').removeClass("navhead-a-active") 298 $(this).parent().siblings("li").removeClass("sub-navhead-active") 299 300 $(this).siblings('ul').find('li .sticker-triangle').removeClass("sub-navhead__sticker-triangle-active") 301 $(this).siblings('ul').find('li a').removeClass("sub-navhead-a-active") 302 $(this).siblings('ul').find('li ').removeClass("sub-navhead-active") 303 $(this).siblings("ul").find('ul').slideUp() 304 305 $(this).parent().siblings("li").find('.sticker-triangle').removeClass("sub-navhead__sticker-triangle-active") 306 $(this).parent().siblings("li").find('a').removeClass("sub-navhead-a-active") 307 308 // æª¢æ¥æ¯å¨åªä¸å±¤é¸å®,æ¿æ´»ç¸éæ¨£å¼ 309 if ($(this).parent().hasClass("sub-navhead")) { 310 $(this).find(".sticker-triangle").toggleClass("sub-navhead__sticker-triangle-active") 311 $(this).parent().toggleClass("sub-navhead-active") 312 $(this).siblings("a").toggleClass("sub-navhead-a-active") 313 } else { 314 $(this).find(".sticker-triangle").toggleClass("sticker-triangle-active") 315 $(this).parent().toggleClass("navhead-active") 316 $(this).siblings("a").toggleClass("navhead-a-active") 317 } 318 } 319 320 }) 321} 322 323// Searchbar 324function searchbar() { 325 326 $('.funcbtn--search').click(function() { 327 $('.main-menu__box-search').slideToggle() 328 $('ul.menulist').removeClass('js-menulist--open') 329 $('.screenmask').removeClass('screenmask--active') 330 }) 331 332 $('.box-search__closebtn').click(function() { 333 $('.main-menu__box-search').slideUp() 334 335 }) 336} 337 338 339// backtotop, transfer the window to topside 340function SidecaseWithBacktotop() { 341 342 if ($("#sidecase").length) { 343 344 $(window).scroll(function() { 345 Initial() 346 }) 347 348 var Initial = function() { 349 scrollTrigger = $(window).height() / 3 * 2 // px 350 scrollTrigger_footer = $(document).height() - $(window).height() - $('footer').height() + 2.5 / 100 * $(window).width() // px 351 } 352 Initial() 353 354 sidecaseShowControl = function() { 355 var scrollTop = $(window).scrollTop() 356 if ($currentpage == 'INDEX') { 357 if (scrollTop > scrollTrigger) { 358 $("#sidecase").addClass("sidecase--show") 359 } else { 360 $("#sidecase").removeClass("sidecase--show") 361 } 362 } 363 364 //æ»å°footeräºé»åè®ç½ 365 if (scrollTop > scrollTrigger_footer) { 366 $("#sidecase").addClass("sidecase--white") 367 } else { 368 $("#sidecase").removeClass("sidecase--white") 369 } 370 } 371 372 if ($currentpage !== 'INDEX') { //è¥éé¦é , #sidecaseå¸¸é§ 373 $("#sidecase").addClass("sidecase--show") 374 } 375 376 sidecaseShowControl() 377 $(window).on("scroll", function() { 378 sidecaseShowControl() 379 }) 380 $("#back-to-top").on("click", function(e) { 381 e.preventDefault() 382 $("html,body").animate({ 383 scrollTop: 0, 384 }, 385 700, 386 "swing" 387 ) 388 }) 389 } 390 391 //ææ©çæsocialbtnSwitchæåºç¾ç¤¾ç¾¤æé 392 $('.socialbtnSwitch').click(function() { 393 $('.socialbtnSwitch').toggleClass('socialbtnSwitch--active') 394 $('.socialbtn-group').toggleClass('socialbtn-group--active') 395 }) 396} 397 398//News context too long will be cut 399function textlengthcut(classname, len_sm, len_md, len_lg) { 400 401 $(classname).each(function() { 402 if ($(this).attr('title') == undefined) { 403 $(this).attr('title', $(this).text()) 404 } 405 }) 406 407 docutting = function() { 408 $(classname).each(function() { 409 if (wdth >= mediawdth_desktop) { 410 if ($(this).attr('title').length > len_lg) { 411 var text = $(this).attr('title').substring(0, len_lg) + '...' 412 $(this).text(text) 413 } 414 } else if (wdth >= mediawdth_tablet && wdth < mediawdth_desktop) { 415 if ($(this).attr('title').length > len_md) { 416 var text = $(this).attr('title').substring(0, len_md) + '...' 417 $(this).text(text) 418 } 419 } else { 420 if ($(this).attr('title').length > len_sm) { 421 var text = $(this).attr('title').substring(0, len_sm) + '...' 422 $(this).text(text) 423 } 424 } 425 }) 426 } 427 428 docutting() 429 430 $(window).resize(function() { 431 docutting() 432 }) 433 434} 435 436//Slick initial 437function Slick_initial(nowpage) { 438 if (nowpage == "INDEX") { 439 //-- é¦é ç¢åæ«¥çª 440 $(".slick-productarea").slick({ 441 infinite: false, 442 slidesToShow: 3, 443 slidesToScroll: 3, 444 autoplay: true, 445 autoplaySpeed: 5000, 446 pauseOnHover: false, 447 pauseOnFocus: false, 448 draggable: false,
449 arrows: false, 450 dots: true, 451 dotsClass: "slick-dots", 452 //has customized at slick-theme.css 453 cssEase: "ease", 454 responsive: [{ 455 breakpoint: 1269, 456 settings: { 457 slidesToShow: 1, 458 slidesToScroll: 1, 459 draggable: true, 460 pauseOnHover: false, 461 pauseOnFocus: false, 462 centerMode: true, 463 }, 464 }, 465 { 466 breakpoint: 767, 467 settings: { 468 slidesToShow: 1, 469 slidesToScroll: 1, 470 centerMode: false, 471 }, 472 }, 473 ], 474 }) 475 } 476} 477 478 479//Swiper initial 480function Swiper_initial() { 481 482 //å¾å°å¯ä»¥å¨ä¸é åµå»ºå¤åjumbotron 483 if ($('.swiper-jumbotron').length) { 484 $('.swiper-jumbotron').each(function(i, el) { 485 const swiper_jumbotron = new Swiper(el, { 486 direction: 'horizontal', 487 allowTouchMove: false, 488 loop: true, 489 slidesPerView: 1, 490 speed: 1500, 491 effect: 'fade', 492 fadeEffect: { 493 crossFade: true, 494 }, 495 autoplay: { 496 delay: 4000 497 }, 498 pagination: { 499 el: '.swiper-jumbotron .swiper-pagination', 500 clickable: true 501 }, 502 503 navigation: { 504 nextEl: '.swiper-jumbotron .swiper-button-next', 505 prevEl: '.swiper-jumbotron .swiper-button-prev', 506 } 507 }); 508 }) 509 } 510 511 if ($('.swiper-cetificate').length) { 512 $('.swiper-cetificate').each(function(i, el) { 513 const swiper_cetificate = new Swiper(el, { 514 direction: 'horizontal', 515 allowTouchMove: true, 516 loop: false, 517 slidesPerView: 2, 518 spaceBetween: 15, 519 speed: 1000, 520 effect: 'slide', 521 navigation: { 522 nextEl: '.swiper-cetificate-btnouter .swiper-button-next', 523 prevEl: '.swiper-cetificate-btnouter .swiper-button-prev', 524 }, 525 breakpoints: { 526 768: { 527 slidesPerView: 4, 528 spaceBetween: 22 529 }, 530 1269: { 531 slidesPerView: 4, 532 spaceBetween: 22 533 } 534 } 535 }); 536 }) 537 } 538 539 if ($('.swiper-video').length) { 540 $('.swiper-video').each(function(i, el) { 541 // $(el).find('.swiper-slide').click(function(){ 542 // alert('123') 543 // }) 544 const swiper_about_video = new Swiper('.swiper-video', { 545 direction: 'horizontal', 546 allowTouchMove: true, 547 loop: false, 548 centeredSlides: true, 549 slidesPerView: 4, 550 spaceBetween: 21, 551 speed: 1200, 552 navigation: { 553 nextEl: '.swiper-video-btnouter .swiper-button-next', 554 prevEl: '.swiper-video-btnouter .swiper-button-prev', 555 }, 556 breakpoints: { 557 // when window width is >= 320px 558 320: { 559 slidesPerView: 1, 560 spaceBetween: 10 561 }, 562 // when window width is >= 480px 563 768: { 564 slidesPerView: 2, 565 spaceBetween: 0 566 }, 567 // when window width is >= 640px 568 1269: { 569 slidesPerView: 3, 570 spaceBetween: 0 571 } 572 }, 573 on: { 574 slideChangeTransitionEnd: function() { 575 $(el).find('.swiper-slide').not('.swiper-slide-active').each(function() { 576 var src = $(this).find('iframe').attr("src"); 577 $(this).find('iframe').attr("src", src); 578 }) 579 } 580 } 581 }); 582 }) 583 } 584 585 if ($('.swiper-recommendarea').length) { 586 $('.swiper-recommendarea').each(function(i, el) { 587 const swiper_recommendarea = new Swiper('.swiper-recommendarea', { 588 direction: 'horizontal', 589 allowTouchMove: true, 590 loop: false, 591 slidesPerView: 1, 592 speed: 1000, 593 effect: 'slide', 594 autoHeight: true, 595 fadeEffect: { 596 crossFade: true, 597 }, 598 // autoplay: { 599 // delay: 2000 600 // }, 601 navigation: { 602 nextEl: '.swiper-recommendarea-btnouter .swiper-button-next', 603 prevEl: '.swiper-recommendarea-btnouter .swiper-button-prev', 604 }, 605 pagination: { 606 el: '.swiper-recommendarea-btnouter .swiper-pagination', 607 clickable: true 608 }, 609 breakpoints: { 610 // when window width is >= 320px 611 320: { 612 slidesPerView: 1, 613 spaceBetween: 15 614 }, 615 // when window width is >= 480px 616 768: { 617 slidesPerView: 2, 618 spaceBetween: 15 619 }, 620 // when window width is >= 640px 621 1269: { 622 slidesPerView: 3, 623 spaceBetween: 16 624 } 625 }, 626 // scrollbar: { 627 // el: '.swiper-scrollbar', 628 // }, 629 }); 630 }) 631 } 632 633 if ($('.swiper-treatment').length) { 634 $('.swiper-treatment').each(function(i, el) { 635 const swiper_about_treatment = new Swiper('.swiper-treatment', { 636 direction: 'horizontal', 637 allowTouchMove: true, 638 loop: false, 639 slidesPerView: 4, 640 spaceBetween: 21, 641 speed: 1200, 642 navigation: { 643 nextEl: '.swiper-treatment-btnouter .swiper-button-next', 644 prevEl: '.swiper-treatment-btnouter .swiper-button-prev', 645 }, 646 pagination: { 647 el: '.swiper-treatment-btnouter .swiper-pagination', 648 clickable: true 649 }, 650 breakpoints: { 651 // when window width is >= 320px 652 320: { 653 slidesPerView: 1, 654 spaceBetween: 15 655 }, 656 // when window width is >= 480px 657 768: { 658 slidesPerView: 2, 659 spaceBetween: 15 660 }, 661 // when window width is >= 640px 662 1269: { 663 slidesPerView: 4, 664 spaceBetween: 20 665 } 666 }, 667 }); 668 }) 669 } 670 671 if ($('.swiper-clinic').length) { 672 $('.swiper-clinic').each(function(i, el) { 673 const swiper_clinic = new Swiper('.swiper-clinic', { 674 direction: 'horizontal', 675 allowTouchMove: true, 676 loop: false, 677 slidesPerView: 1, 678 spaceBetween: 20, 679 speed: 1200, 680 navigation: { 681 nextEl: '.swiper-clinic-outer .swiper-button-next', 682 prevEl: '.swiper-clinic-outer .swiper-button-prev', 683 }, 684 pagination: { 685 el: '.swiper-clinic-outer .swiper-pagination', 686 clickable: true 687 }, 688 breakpoints: { 689 768: { 690 slidesPerView: 2, 691 spaceBetween: 24 692 } 693 }, 694 }); 695 }) 696 } 697 698 if ($('.swiper-caseShare').length) { 699 $('.swiper-caseShare').each(function(i, el) { 700 const swiper_caseShare = new Swiper('.swiper-caseShare', { 701 direction: 'horizontal', 702 allowTouchMove: true, 703 loop: false, 704 slidesPerView: 1, 705 spaceBetween: 20, 706 speed: 1200, 707 navigation: { 708 nextEl: '.swiper-caseShare-btnouter .swiper-button-next', 709 prevEl: '.swiper-caseShare-btnouter .swiper-button-prev', 710 }, 711 pagination: { 712 el: '.swiper-caseShare-btnouter .swiper-pagination', 713 clickable: true 714 }, 715 breakpoints: { 716 768: { 717 slidesPerView: 2, 718 spaceBetween: 24 719 } 720 }, 721 }); 722 }) 723 } 724 725 if ($('.swiper-experience').length) { 726 $('.swiper-experience').each(function(i, el) { 727 var el_prev = $(this).closest('.swiper-experience-btnouter').find('.swiper-button-prev')[0] 728 var el_next = $(this).closest('.swiper-experience-btnouter').find('.swiper-button-next')[0] 729 var el_pagination = $(this).closest('.swiper-experience-btnouter').find('.swiper-pagination')[0] 730 swiper_experience = new Swiper(this, { 731 direction: 'horizontal', 732 allowTouchMove: true, 733 loop: false, 734 slidesPerView: 1, 735 spaceBetween: 20, 736 speed: 1200, 737 navigation: { 738 nextEl: el_next, 739 prevEl: el_prev, 740 }, 741 pagination: { 742 el: el_pagination, 743 clickable: true 744 }, 745 breakpoints: { 746 768: { 747 slidesPerView: 3, 748 spaceBetween: 16 749 } 750 }, 751 }); 752 }) 753 } 754 755 if ($('.swiper-pagebanner').length) { 756 $('.swiper-pagebanner').each(function(i, el) { 757 const swiper_pagebanner = new Swiper(this, { 758 direction: 'horizontal', 759 allowTouchMove: true, 760 loop: true, 761 slidesPerView: 1, 762 speed: 2000,
763 autoHeight: true, 764 effect: 'slide', 765 autoplay: { 766 delay: 4000 767 }, 768 pagination: { 769 el: '.swiper-pagination', 770 clickable: true 771 }, 772 navigation: { 773 nextEl: '.swiper-pagebanner .swiper-button-next', 774 prevEl: '.swiper-pagebanner .swiper-button-prev', 775 }, 776 }); 777 }) 778 } 779 780 if ($('.swiper-courseShareCard').length) { 781 $('.swiper-courseShareCard').each(function(i, el) { 782 const swiper_courseShareCard = new Swiper(this, { 783 direction: 'horizontal', 784 allowTouchMove: true, 785 loop: false, 786 slidesPerView: 1, 787 spaceBetween: 20, 788 speed: 1200, 789 navigation: { 790 nextEl: $(this).siblings('.swiper-button-next')[0], 791 prevEl: $(this).siblings('.swiper-button-prev')[0], 792 }, 793 pagination: { 794 el: $(this).siblings('.swiper-pagination')[0], 795 clickable: true 796 }, 797 }); 798 }) 799 } 800 801 if ($currentpage == "INDEX") { 802 803 const swiper_newsarea = new Swiper('.swiper-newsarea', { 804 direction: 'horizontal', 805 allowTouchMove: true, 806 loop: false, 807 slidesPerView: 1, 808 speed: 1000, 809 effect: 'slide', 810 fadeEffect: { 811 crossFade: true, 812 }, 813 // autoplay: { 814 // delay: 2000 815 // }, 816 navigation: { 817 nextEl: '.swiper-newsarea-btnouter .swiper-button-next', 818 prevEl: '.swiper-newsarea-btnouter .swiper-button-prev', 819 }, 820 breakpoints: { 821 // when window width is >= 320px 822 320: { 823 slidesPerView: 1, 824 spaceBetween: 15 825 }, 826 // when window width is >= 480px 827 768: { 828 slidesPerView: 3, 829 spaceBetween: 15 830 }, 831 // when window width is >= 640px 832 1269: { 833 slidesPerView: 4, 834 spaceBetween: 21 835 } 836 }, 837 // scrollbar: { 838 // el: '.swiper-scrollbar', 839 // }, 840 }); 841 842 const swiper_indexbanner = new Swiper('.swiper-indexbanner', { 843 direction: 'horizontal', 844 allowTouchMove: true, 845 loop: true, 846 slidesPerView: 1, 847 speed: 1000, 848 effect: 'slide', 849 fadeEffect: { 850 crossFade: true, 851 }, 852 autoplay: { 853 delay: 3000 854 }, 855 pagination: { 856 el: '.swiper-pagination', 857 clickable: true 858 }, 859 }); 860 } 861 862 if ($currentpage == "ABOUT") { 863 864 const swiper_about_newsarea = new Swiper('.swiper-newsarea', { 865 direction: 'horizontal', 866 allowTouchMove: true, 867 loop: false, 868 slidesPerView: 1, 869 speed: 1000, 870 effect: 'slide', 871 fadeEffect: { 872 crossFade: true, 873 }, 874 // autoplay: { 875 // delay: 2000 876 // }, 877 navigation: { 878 nextEl: '.swiper-newsarea-btnouter .swiper-button-next', 879 prevEl: '.swiper-newsarea-btnouter .swiper-button-prev', 880 }, 881 breakpoints: { 882 // when window width is >= 320px 883 320: { 884 slidesPerView: 1, 885 spaceBetween: 15 886 }, 887 // when window width is >= 480px 888 768: { 889 slidesPerView: 2, 890 spaceBetween: 15 891 }, 892 // when window width is >= 640px 893 1269: { 894 slidesPerView: 4, 895 spaceBetween: 21 896 } 897 }, 898 // scrollbar: { 899 // el: '.swiper-scrollbar', 900 // }, 901 }); 902 903 904 } 905 906 if ($currentpage == "PRODUCTSDETAIL") { 907 const swiper_thumb = new Swiper('.swiper-thumb', { 908 direction: 'horizontal', 909 allowTouchMove: true, 910 loop: false, 911 spaceBetween: 8, 912 slidesPerView: 4,
913 speed: 800, 914 freeMode: true, 915 watchSlidesProgress: true, 916 effect: 'slide', 917 fadeEffect: { 918 crossFade: true, 919 }, 920 navigation: { 921 nextEl: '.swiper-thumb-btnouter .swiper-button-next', 922 prevEl: '.swiper-thumb-btnouter .swiper-button-prev', 923 }, 924 scrollbar: { 925 el: '.swiper-thumb-btnouter .swiper-scrollbar', 926 draggable: true, 927 }, 928 }); 929 930 const swiper_nail = new Swiper('.swiper-nail', { 931 direction: 'horizontal', 932 allowTouchMove: true, 933 loop: false, 934 slidesPerView: 1, 935 speed: 1000, 936 effect: 'slide', 937 thumbs: { 938 swiper: swiper_thumb 939 }, 940 controller: { 941 inverse: true, 942 }, 943 }); 944 945 946 $('.swiper-thumb-btnouter .swiper-button-next').mouseenter(function() { 947 $(this).trigger('click') 948 thumbMoveNextInterval = setInterval(() => { 949 $(this).trigger('click') 950 }, 600) 951 }) 952 $('.swiper-thumb-btnouter .swiper-button-next').mouseleave(function() { 953 clearInterval(thumbMoveNextInterval) 954 }) 955 $('.swiper-thumb-btnouter .swiper-button-prev').mouseenter(function() { 956 $(this).trigger('click') 957 thumbMovePrevInterval = setInterval(() => { 958 $(this).trigger('click') 959 }, 600) 960 }) 961 $('.swiper-thumb-btnouter .swiper-button-prev').mouseleave(function() { 962 clearInterval(thumbMovePrevInterval) 963 }) 964 965 const swiper_plusbuy = new Swiper('.swiper-plusbuy', { 966 direction: 'horizontal', 967 allowTouchMove: true, 968 loop: false, 969 spaceBetween: 10, 970 slidesPerView: 1, 971 speed: 1300, 972 effect: 'slide', 973 navigation: { 974 nextEl: '.swiper-plusbuy-btnouter .swiper-button-next', 975 prevEl: '.swiper-plusbuy-btnouter .swiper-button-prev', 976 }, 977 breakpoints: { 978 // when window width is >= 480px 979 768: { 980 slidesPerView: 2, 981 spaceBetween: 10 982 }, 983 // when window width is >= 640px 984 1269: { 985 slidesPerView: 3, 986 spaceBetween: 10 987 } 988 }, 989 }); 990 } 991 992 if ($currentpage == "ALBUM") { 993 const swiper_thumb = new Swiper('.swiper-thumb', { 994 direction: 'horizontal', 995 allowTouchMove: true, 996 loop: false, 997 spaceBetween: 5, 998 slidesPerView: 4, 999 speed: 800, 1000 freeMode: true, 1001 watchSlidesProgress: true, 1002 effect: 'slide', 1003 fadeEffect: { 1004 crossFade: true, 1005 }, 1006 scrollbar: { 1007 el: '.swiper-thumb-btnouter .swiper-scrollbar', 1008 draggable: true, 1009 }, 1010 breakpoints: { 1011 // when window width is >= 320px 1012 768: { 1013 spaceBetween: 11 1014 } 1015 }, 1016 }); 1017 1018 const swiper_nail = new Swiper('.swiper-nail', { 1019 direction: 'horizontal', 1020 allowTouchMove: true, 1021 loop: false, 1022 slidesPerView: 1, 1023 speed: 1000, 1024 effect: 'slide', 1025 thumbs: { 1026 swiper: swiper_thumb 1027 }, 1028 navigation: { 1029 nextEl: '.swiper-nail-btnouter .swiper-button-next', 1030 prevEl: '.swiper-nail-btnouter .swiper-button-prev', 1031 }, 1032 controller: { 1033 inverse: true, 1034 }, 1035 }); 1036 1037 1038 $('.swiper-thumb-btnouter .swiper-button-next').hover(function() { 1039 $(this).trigger('click') 1040 }) 1041 $('.swiper-thumb-btnouter .swiper-button-prev').hover(function() { 1042 $(this).trigger('click') 1043 }) 1044 1045 const swiper_products = new Swiper('.swiper-products', { 1046 direction: 'horizontal', 1047 allowTouchMove: true, 1048 loop: false, 1049 spaceBetween: 6, 1050 slidesPerView: 2, 1051 speed: 1000, 1052 effect: 'slide', 1053 controller: { 1054 inverse: true, 1055 }, 1056 pagination: { 1057 el: '.swiper-products-outer .swiper-pagination', 1058 clickable: true 1059 }, 1060 breakpoints: { 1061 // when window width is >= 320px 1062 768: { 1063 slidesPerView: 3, 1064 spaceBetween: 11 1065 } 1066 }, 1067 1068 }); 1069 } 1070} 1071 1072//é¦é æ°èæ¬ 1073function newsbarControl() { 1074 if ($('#newsbar').length > 0) { 1075 setInterval(function() {
1076 $('#newsbar li:first-child').slideUp(function() { 1077 $(this).appendTo($('#newsbar ul')).slideDown() 1078 }) 1079 }, 5000) 1080 } 1081} 1082 1083// Flexslider initial 1084function Flexslider_initial() { 1085 if ($(".flexslider").length > 0) { 1086 //>0ï¼é¿å æ¾ä¸å°å·è¡å¤±æèå°è´å¾çºjsç¡æ³å·è¡ 1087 $(".flexslider").flexslider({ 1088 animation: "slide", 1089 controlNav: "thumbnails", 1090 directionNav: false, 1091 }) 1092 } 1093} 1094 1095function style_checkbox() { 1096 $('.inquirylist__item').click(function() { 1097 if ($(this).find('input').prop('checked') == true) { 1098 $(this).removeClass('bg-color--gray') 1099 $(this).addClass('bg-color--primary') 1100 $(this).removeClass('color--contentblack') 1101 $(this).addClass('color--white') 1102 $(this).find('.inquirylist__checkbox::before').css('visibility', 'visible') 1103 $(this).find('.inquirylist__checkbox::after').css('visibility', 'visible') 1104 } else { 1105 $(this).removeClass('bg-color--primary') 1106 $(this).addClass('bg-color--gray') 1107 $(this).removeClass('color--white') 1108 $(this).addClass('color--contentblack') 1109 } 1110 }) 1111} 1112 1113 1114//Control the .faqbox shrink and stretch 1115function faqboxcontrol(allsw) { 1116 1117 //Step1. faqbox æéé«åº¦RWDèª¿æ´ 1118 $('.faqbox__arrowbtn').each(function() { 1119 $(this).css('height', '0') 1120 var queheight = $(this).parent().css('height') 1121 $(this).css('height', queheight) 1122 }) 1123 1124 1125 $('.faqbox__head').click(function() { 1126 if ($(this).parent('.faqbox').hasClass('faqbox--active')) { 1127 //黿çé ç®ç§»é¤active, 黿çé ç®çæ¡éé 1128 $(this).parent('.faqbox').removeClass('faqbox--active') 1129 $(this).siblings('.faqbox__ans').slideUp() 1130 } else { 1131 if (allsw === true) { 1132 //ææç§»é¤active, çæ¡éé 1133 $('.faqbox').removeClass('faqbox--active') 1134 $('.faqbox__head').siblings('.faqbox__ans').slideUp() 1135 } 1136 1137 //黿çé ç®æ°å¢active, 黿çé ç®çæ¡æé 1138 $(this).parent('.faqbox').addClass('faqbox--active') 1139 $(this).siblings('.faqbox__ans').slideDown() 1140 } 1141 }) 1142 1143} 1144 1145function dropdownControl() { 1146 1147 $('.js-dropdown').each(function() { 1148 if ($(this).attr('data-dropdown-open') == 'true') { 1149 $(this).find('.js-dropdown__body').show() 1150 $(this).find('.js-dropdown__head').addClass('js-dropdown__head--active') 1151 } else { 1152 $(this).find('.js-dropdown__body').hide() 1153 } 1154 }) 1155 1156 $('.js-dropdown__head').click(function() { 1157 $(this).toggleClass('js-dropdown__head--active') 1158 $(this).closest('.js-dropdown').children('.js-dropdown__body').slideToggle() 1159 if ($(this).closest('.js-dropdown').attr('data-dropdown-individual') == "true") {} else { 1160 $(this).closest('.js-dropdown').siblings('.js-dropdown').find('.js-dropdown__head').removeClass('js-dropdown__head--active') 1161 $(this).closest('.js-dropdown').siblings('.js-dropdown').find('.js-dropdown__body').slideUp() 1162 } 1163 1164 // proitem樣å¼è£ä¸ 1165 // if($(this).closest('.js-dropdown').attr('data-dropdown-individual')=="true"){}else{ 1166 // $(this).closest('.proitem').siblings('.proitem').find('.proitem__head').removeClass('bg-color--primary color--white') 1167 // } 1168 // if ($(this).hasClass('js-dropdown__head--active')) { 1169 // $(this).closest('.proitem').find('.proitem__head').addClass('bg-color--primary color--white') 1170 // } else { 1171 // $(this).closest('.proitem').find('.proitem__head').removeClass('bg-color--primary color--white') 1172 // } 1173 }) 1174} 1175 1176//èªåçºinput[type="checkbox"]çidåä¸ä¸ålabelçfor å ä¸å°æç·¨è 1177function checkboxGiveId() { 1178 var id = 0 1179 $('input[type="checkbox"]').each(function() { 1180 $(this).attr('id', 'c' + id) 1181 $(this).next('label').attr('for', 'c' + id) 1182 id++ 1183 }) 1184} 1185 1186//èªåçºinput[type="radio"]çidåä¸ä¸ålabelçfor å ä¸å°æç·¨è 1187function radioGiveId() { 1188 var id = 0 1189 $('input[type="radio"]').each(function() { 1190 $(this).attr('id', 'r' + id) 1191 $(this).next('label').attr('for', 'r' + id) 1192 id++ 1193 }) 1194} 1195 1196//æå並å·è¡å®¢è£½åselect 1197function style_select_init() { 1198 $(".js-slt-styleoutter").each(function(i) { 1199 var selectName = "customSelect-" + (i + 1) 1200 $(this).attr("id", selectName) 1201 style_select(selectName) 1202 }) 1203} 1204 1205//å·è¡å®¢è£½åselect 1206function style_select(custumSelect) { 1207 var custumSelect = "#" + custumSelect 1208 $(custumSelect).find($(".slt-style").hide()) 1209 $(custumSelect).find(".slt-style").css('opacity', '1') 1210 var select_totalnum = $(custumSelect) 1211 .find(".slt-style") 1212 .find(".slt-style__option").length 1213 var j = 0 // idåå§å¼ 1214 var idArrar = [] 1215 var is_showChange = $(custumSelect).data('show-change') //黿optionå¾ showçæåæ¯å¦æ¹è® 1216 if ($(custumSelect).find(".slt-style-show").html() == '') { 1217 $(custumSelect) 1218 .find(".slt-style-show") 1219 .html($(custumSelect).find(".slt-style__option").eq(0).html()) 1220 } 1221 1222 // çºåå¥__option建ç«data-mother-idåºè 1223 $(custumSelect).find('.slt-style__option').each(function(i) { 1224 $(this).attr('data-mother-id', i) 1225 }) 1226 1227 // å°åå¥__optionçdata-valueå³çµ¦select裡çoption 1228 $(custumSelect) 1229 .find(".slt-style__option") 1230 .each(function() { 1231 idArrar[j] = $(this).attr("data-value") 1232 j++ 1233 }) 1234 1235 //建ç«option 1236 for (let i = 0; i < select_totalnum; i++) { 1237 $(custumSelect).find(".slt-style").siblings('select').append('<option value="' + idArrar[i] + '"data-child-id="' + i + '">' + idArrar[i] + "</option>") 1238 } 1239 1240 // å¨ç¬¬ä¸ä½æ·»å¢ä¸åvalerçºç©ºçé¸é ï¼ä½¿è©²selecté è¨é¸é çºç©ºå¼ 1241 $(custumSelect).find(".slt-style").siblings('select').prepend('<option value="" selected></option>') 1242 1243 1244 //黿showä¹å¾åçäº 1245 $(custumSelect) 1246 .find(".slt-style-show") 1247 .click(function() { 1248 if ($(this).siblings('.slt-style').hasClass('slt-style--opened')) {
1249 //黿,æ¶èµ·å®æå¾ç§»é¤.slt-style--opened 1250 $(this).siblings('.slt-style').slideUp(300, function() { 1251 $(this).removeClass('slt-style--opened') 1252 }).siblings(".slt-styleoutter__arrow").removeClass("is-upside-down--top50") 1253 } else { 1254 //黿,éå宿å¾å¢å .slt-style--opened 1255 $(this).siblings('.slt-style').slideDown(300, function() { 1256 $(this).addClass('slt-style--opened') 1257 }).siblings(".slt-styleoutter__arrow").addClass("is-upside-down--top50") 1258 } 1259 }) 1260 1261 //é»æå®¢è£½é¸é optionåçäº 1262 $(custumSelect) 1263 .find(".slt-style__option") 1264 .click(function() { 1265 $(this).parent().slideToggle() 1266 $(custumSelect) 1267 .find(".slt-styleoutter__arrow") 1268 .toggleClass("is-upside-down--top50") 1269 var select_html = $(this).html() 1270 var select_id = $(this).attr("data-mother-id") 1271 if (is_showChange !== false) { 1272 $(custumSelect).find(".slt-style-show").html(select_html) 1273 } 1274 $(custumSelect) 1275 .find(".slt-style") 1276 .siblings('select') 1277 .children() 1278 .removeAttr("selected", "") 1279 $(custumSelect) 1280 .find(".slt-style") 1281 .siblings('select') 1282 .children() 1283 .each(function() { 1284 if ($(this).attr("data-child-id") == select_id) { 1285 $(this).attr("selected", "") 1286 } 1287 }) 1288 $(custumSelect).find(".slt-style").siblings('select').change() 1289 }) 1290 1291 // æå°åè½ 1292 $(custumSelect) 1293 .find(".slt-style__search .slt-style__search-input").keyup(function() { 1294 var keyword = $(this).val().toLowerCase(); // åå¾è¼¸å ¥çééµå並è½å°å¯« 1295 1296 // å°æ¾ææé¸é 1297 $(this).closest('.slt-style').find('.slt-style__option').each(function() { 1298 var optionText = $(this).text().toLowerCase(); // åå¾é¸é æå並è½å°å¯« 1299 // 檢æ¥é¸é æåæ¯å¦å å«ééµå 1300 if (optionText.indexOf(keyword) > -1) { 1301 $(this).show(); // å å«ééµåå顯示 1302 } else { 1303 $(this).hide(); // ä¸å å«ééµååé±è 1304 } 1305 }); 1306 }) 1307 1308 $('body').click(function(e) { 1309 // 檢æ¥é»æçç®æ¨çº.js-slt-styleoutteréåå ä»¶ï¼ä¸é¸å®æ¬ä¾å°±æ¯å±éæï¼å°±ä¸æ¶èµ·é¸å®ã(æ¯çºäºAé¸å®éåæï¼é»æå ¶ä»çé¸å®ä¹è¦æ¶èµ·Aé¸å®ãä½è¥æ¯é»æéé¸å®çå°æ¹ä¹è¦æ¶èµ·é¸å®) 1310 if ($(e.target).closest('.js-slt-styleoutter').length && $(e.target).closest('.slt-style').hasClass('slt-style--opened')) {} else { 1311 $('.slt-style.slt-style--opened').slideUp(300, function() { 1312 $(this).removeClass('slt-style--opened') 1313 }).siblings(".slt-styleoutter__arrow").removeClass("is-upside-down--top50") 1314 } 1315 }) 1316} 1317 1318function sociallinkAnimation() { 1319 $('.sociallink').hover(function() { 1320 console.log($(this)) 1321 if ($(this).hasClass('sociallink--active')) {} else { 1322 $(this).addClass('sociallink--active') 1323 setTimeout(() => { 1324 $(this).removeClass('sociallink--active') 1325 }, 1100) 1326 } 1327 }) 1328} 1329 1330function productboxControl() { 1331 1332 //æçææå忍£å¼ 1333 $('.productbox').each(function() { 1334 if ($(this).hasClass('productbox--favoriteAdded')) { 1335 $(this).find('.productbox__favorite').html('<i class="fa-solid fa-heart"></i>') 1336 } 1337 }) 1338 1339 //æ°åä¸å¸, ç±é·æè¡ å tagå°æ¨ç±¤ 1340 switch ($currentpage) { 1341 case 'BESTSELLER': 1342 for (let i = 0; i < 4; i++) { 1343 $('.productbox-group .productbox').eq(i).append('<div class="productbox__tag productbox__tag--top"><span>TOP</span><span>' + (i + 1) + '</span></div>') 1344 } 1345 break; 1346 case 'NEWARRIVAL': 1347 for (let i = 0; i < 4; i++) { 1348 $('.productbox-group .productbox').eq(i).append('<div class="productbox__tag productbox__tag--new"><span>NEW</span></div>') 1349 } 1350 break; 1351 } 1352} 1353 1354function tabboxControl() { 1355 1356 $('.tabbox').each(function() { 1357 var whichPage = $(this).data('current') 1358 var that = $(this) 1359 var mother = [] 1360 if (whichPage != undefined) { 1361 that.children('.tabbox__mothers').children('.tabbox__mother').eq(whichPage - 1).addClass('tabbox__mother--active') 1362 } else { 1363 that.children('.tabbox__mothers').children('.tabbox__mother').eq(0).addClass('tabbox__mother--active') 1364 } 1365 that.children('.tabbox__mothers').children('.tabbox__mother').each(function() { 1366 mother.push($(this)) 1367 }) 1368 if (whichPage != undefined) { 1369 that.children('.tabbox__children').children('.tabbox__child').eq(whichPage - 1).addClass('tabbox__child--active') 1370 } else { 1371 that.children('.tabbox__children').children('.tabbox__child').eq(0).addClass('tabbox__child--active') 1372 } 1373 mother.forEach(function(v, i) { 1374 v.click(function() { 1375 v.siblings('.tabbox__mother').removeClass('tabbox__mother--active') 1376 v.addClass('tabbox__mother--active') 1377 that.children('.tabbox__children').children('.tabbox__child').removeClass('tabbox__child--active') 1378 that.children('.tabbox__children').children('.tabbox__child').eq(i).addClass('tabbox__child--active') 1379 }) 1380 }) 1381 }) 1382 1383} 1384 1385function discountboxShow() { 1386 1387 $('.discountbox-group').each(function() { 1388 var timediff = 100 //åºç¾çæéå·® 1389 $(this).children('.discountbox').each(function() { 1390 $(this).css('animation-delay', timediff + 'ms') 1391 timediff += timediff 1392 }) 1393 }) 1394} 1395 1396 1397function timestampToDate() { 1398 var timestamp = Number($('.js-date').find('span').text()) 1399 var date = new Date(timestamp * 1000) 1400 var year = date.getFullYear()
1401 var month = date.getMonth() 1402 var day = date.getDate() 1403 1404 switch (month) { 1405 case 1: 1406 month = "January"; 1407 break; 1408 case 2: 1409 month = "February"; 1410 break; 1411 case 3: 1412 month = "March"; 1413 break; 1414 case 4: 1415 month = "April"; 1416 break; 1417 case 5: 1418 month = "May"; 1419 break; 1420 case 6: 1421 month = "June"; 1422 break; 1423 case 7: 1424 month = "July"; 1425 break; 1426 case 8: 1427 month = "August"; 1428 break; 1429 case 9: 1430 month = "September"; 1431 break; 1432 case 10: 1433 month = "October"; 1434 break; 1435 case 11: 1436 month = "November"; 1437 break; 1438 case 12: 1439 month = "December"; 1440 break; 1441 } 1442 1443 $('.js-date span').text(month + ' ' + day + ', ' + year) 1444} 1445 1446function inputTYPEcheck() { 1447 $('input[type="tel"]').change(function() { 1448 if (isNaN($(this).val())) { 1449 alert( 1450 "ï¼ï¼ï¼ï¼ï¼è²¼å¿æéï¼ï¼ï¼ï¼ï¼\n\n è¼¸å ¥çé»è©±è碼è«çºæ¸ååå½¢å·ï¼ï¼ï¼" 1451 ) 1452 $(this).val("") 1453 } 1454 }) 1455 1456 //E-MAILæ ¼å¼æª¢æ¥ 1457 $('input[type="email"]').change(function() { 1458 $Emailchecking = IsEmail($(this).val()) 1459 if ($Emailchecking == false) { 1460 alert("ï¼ï¼ï¼ï¼ï¼è²¼å¿æéï¼ï¼ï¼ï¼ï¼\n\n è«å¡«å¯«æ£ç¢ºçE-MAILæ ¼å¼å·ï¼ï¼ï¼") 1461 $(this).val("") 1462 $(this).blur() //é¢éç¦é» 1463 } 1464 }) 1465 1466 //é»è©±æ ¼å¼æª¢æ¥ 1467 $("#telephone").change(function() { 1468 var regex = /^(\d{2,3}-?|\(\d{2,3}\))\d{3,4}-?\d{4}$/ 1469 if (!regex.test($(this).val())) { 1470 alert( 1471 "ï¼ï¼ï¼ï¼ï¼è²¼å¿æéï¼ï¼ï¼ï¼ï¼\n\n è¼¸å ¥çæåé 符åé»è©±æ ¼å¼(ä¸çºåå½¢æå)ï¼" 1472 ) 1473 $(this).val("") 1474 } 1475 }) 1476 1477 //Emailæ ¼å¼æª¢æ¥ 1478 function IsEmail(email) { 1479 var regex = 1480 /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/ 1481 if (!regex.test(email)) { 1482 return false 1483 } else { 1484 return true 1485 } 1486 } 1487 1488 //å¯ç¢¼ï¼åæ¬¡è¼¸å ¥å¯ç¢¼ éç¸å 1489 $("#repassword").change(function() { 1490 var pswd = $("#password").val() 1491 if (pswd == $(this).val()) {} else { 1492 alert("å¯ç¢¼é ç¸å") 1493 $(this).val("") 1494 } 1495 }) 1496 1497 $("#password").change(function() { 1498 var pswdre = $("#repassword").val() 1499 if (pswdre == $(this).val()) {} else { 1500 if (pswdre.length == 0) {} else { 1501 alert("å¯ç¢¼é ç¸å") 1502 $("#repassword").val("") 1503 } 1504 } 1505 }) 1506 1507 // Classå¥ç¨ 1508 $('input[type="text"]').change(function() { 1509 if ($(this).val() == "") { 1510 $(this).removeClass("input-style-A--success") 1511 } else { 1512 $(this).addClass("input-style-A--success") 1513 } 1514 }) 1515 1516 $("textarea").change(function() { 1517 if ($(this).val() == "") { 1518 $(this).removeClass("input-style-A--success") 1519 } else { 1520 $(this).addClass("input-style-A--success") 1521 } 1522 }) 1523 1524 $(".input-style-C").focus(function() { 1525 $(this) 1526 .parent(".input-style-C-outter") 1527 .addClass("input-style-C-outter--success") 1528 }) 1529 1530 $(".input-style-C").blur(function() { 1531 if ($(this).val() == "") { 1532 $(this) 1533 .parent(".input-style-C-outter") 1534 .removeClass("input-style-C-outter--success") 1535 } else { 1536 $(this) 1537 .parent(".input-style-C-outter") 1538 .addClass("input-style-C-outter--success") 1539 } 1540 }) 1541} 1542 1543 1544// item appear way 1545function waterfallshow(cp) { 1546 //cp = $currentpage 1547 //Give .wow.fadeIn class in DOM's target 1548 1549 if (cp == 'PRODUCTS') { 1550 var j = 1; 1551 $('.productbox').each(function() { 1552 // $(this).attr('id', 'pc' + i); 1553 j++; 1554 $(this).attr('data-wow-delay', (j / 10) + 's'); 1555 $(this).attr('data-wow-offset', -20000); 1556 }) 1557 } 1558 1559} 1560 1561function BLOCKAnimation(nowpage) { 1562 var scrollTrigger = 400 // px 1563 var wh = $(window).height() 1564 1565 if (nowpage == "INDEX") { 1566 Animation_aboutarea_done = false 1567 Animation_newsarea_done = false 1568 1569 Detectblock = function() { 1570 //é¦é Aboutarea é²å ´åç« 1571 Animation_aboutarea = function() { 1572 $(".aboutarea__meatball").addClass("fadeIn") 1573 $(".aboutarea__meatball").addClass("animated") 1574 1575 setTimeout(function() { 1576 $(".aboutarea__sauce").addClass("fadeIn") 1577 $(".aboutarea__sauce").addClass("animated") 1578 }, 500) 1579 1580 setTimeout(function() { 1581 $(".newsarea__seafood").addClass("fadeIn") 1582 $(".newsarea__seafood").addClass("animated") 1583 }, 800) 1584 1585 setTimeout(function() { 1586 $(".block-aboutarea .heading-index").addClass("ghostInDown") 1587 }, 1100) 1588 1589 setTimeout(function() { 1590 $(".aboutarea__content").addClass("ghostInUp") 1591 }, 1300) 1592 1593 setTimeout(function() { 1594 $( 1595 ".block-aboutarea .heading-index .heading-index__cloud img" 1596 ).addClass("ghostInRightUp") 1597 }, 1500) 1598 1599 Animation_aboutarea_done = true 1600 } 1601 1602 //é¦é Newsarea é²å ´åç« 1603 Animation_newsarea = function() { 1604 setTimeout(function() { 1605 $(".newsarea__title").addClass("fadeInLeft") 1606 $(".newsarea__title").addClass("animated") 1607 }, 500) 1608 1609 Animation_newsarea_done = true 1610 } 1611 if (Animation_aboutarea_done == true) {} else { 1612 var Distance_aboutarea = 1613 wh - ($(".aboutarea").offset().top - $(window).scrollTop()) 1614 if (Distance_aboutarea <= scrollTrigger) {} else if (Distance_aboutarea > wh) {} else { 1615 Animation_aboutarea() 1616 } 1617 } 1618 1619 if (Animation_newsarea_done == true) {} else { 1620 var Distance_newsarea = 1621 wh - ($(".newsarea").offset().top - $(window).scrollTop()) 1622 if (Distance_newsarea <= scrollTrigger) {} else if (Distance_newsarea > wh) {} else { 1623 Animation_newsarea() 1624 } 1625 } 1626 } 1627 1628 Detectblock() 1629 $(window).on("scroll", function() { 1630 Detectblock() 1631 }) 1632 } 1633} 1634 1635//ç®æ¨ç©$(''), ç®æ¨ç©é¢windowåºé¨è·é¢å¤å°è§¸ç¼(嵿¸¬çæ¯ç®æ¨ç©çé ), ç®æ¨ç©é¢windowé é¨è·é¢å¤å°è§¸ç¼(嵿¸¬çæ¯ç®æ¨ç©çåº), éè¤å·è¡å½å¼?, 觸ç¼çå½å¼ 1636// ScrollReachRun($('.test'), 200, 200, false, function() { 1637// console.log('func') 1638// }) 1639 1640function ScrollReachRun(target, TriggerDistance_bottom, TriggerDistance_top, isRepeat, func) { 1641 if (target.length > 0) { 1642 var flag_done = false 1643 var wh = $(window).height() 1644 $(window).resize(function() { 1645 wh = $(window).height() 1646 }) 1647 const SrollDetectblock = function(func, isRepeat) { 1648 var Distance_target = wh - (target.offset().top - $(window).scrollTop()) 1649 if (Distance_target <= TriggerDistance_bottom) {} else if (Distance_target - target.height() + TriggerDistance_top > wh) {} else { 1650 func() 1651 if (isRepeat == false) { 1652 flag_done = true 1653 } 1654 } 1655 } 1656 SrollDetectblock(func, isRepeat) 1657 $(window).on("scroll", function() { 1658 if (flag_done == false) { 1659 SrollDetectblock(func, isRepeat) 1660 } 1661 }) 1662 } 1663} 1664 1665function navheadStyleControl() { 1666 $('.navhead').each(function() { 1667 // console.log($(this).data('page')) 1668 if ($(this).data('page') == $currentpage) { 1669 $(this).addClass('navhead--current') 1670 } 1671 }) 1672} 1673 1674// å°cookie以é£åå½¢å¼å²å 1675function parseCookie() { 1676 var cookieObj = {} 1677 var cookieAry = document.cookie.split(";") 1678 var cookie 1679 1680 for (var i = 0, l = cookieAry.length; i < l; ++i) { 1681 cookie = jQuery.trim(cookieAry[i]) 1682 cookie = cookie.split("=")
1683 cookieObj[cookie[0]] = cookie[1] 1684 } 1685 1686 return cookieObj 1687} 1688 1689//è®åcookie,弿¸å¡«è®æ¸å稱,æåå³å¼ 1690function getCookieByName(name) { 1691 var value = parseCookie()[name] 1692 if (value) { 1693 value = decodeURIComponent(value) 1694 } 1695 1696 return value 1697} 1698 1699function policyblock() { 1700 1701 var websitename = $('head title').text() 1702 1703 //䏿çé±ç§æ¬æ¿ç 1704 $(".block-policy--cht").html( 1705 "<article class='policy_page'> <div class='policy_pageBlank'> <div class='policy_wp'> <div class='policy_content'> <div class='policy_title1'>é±ç§æ¬æ¿ç Private Policy</div> é常æ¡è¿æ¨å è¨ã" + websitename + "ãï¼ä»¥ä¸ç°¡ç¨±æ¬ç¶²ç«ï¼ï¼çºäºè®æ¨è½å¤ å®å¿çä½¿ç¨æ¬ç¶²ç«çåé æåèè³è¨ï¼ç¹æ¤åæ¨èªªææ¬ç¶²ç«çé±ç§æ¬ä¿è·æ¿çï¼ä»¥ä¿éæ¨çæ¬çï¼è«æ¨è©³é±ä¸åå §å®¹ï¼ <br><br> <div class='policy_title2'>ä¸ãé±ç§æ¬ä¿è·æ¿ççé©ç¨ç¯å</div> é±ç§æ¬ä¿è·æ¿çå §å®¹ï¼å æ¬æ¬ç¶²ç«å¦ä½èç卿¨ä½¿ç¨ç¶²ç«æåææ¶éå°çå人èå¥è³æãé±ç§æ¬ä¿è·æ¿çä¸é©ç¨æ¼æ¬ç¶²ç«ä»¥å¤çç¸éé£çµç¶²ç«ï¼ä¹ä¸é©ç¨æ¼éæ¬ç¶²ç«æå§è¨æåè管çç人å¡ã <br> <br> <div class='policy_title2'>äºãåäººè³æçèéãèçåå©ç¨æ¹å¼</div> ç¶æ¨é 訪æ¬ç¶²ç«æä½¿ç¨æ¬ç¶²ç«ææä¾ä¹åè½æåæï¼æåå°è¦è©²æååè½æ§è³ªï¼è«æ¨æä¾å¿ è¦çåäººè³æï¼ä¸¦å¨è©²ç¹å®ç®çç¯åå §èçåå©ç¨æ¨çåäººè³æï¼éç¶æ¨æ¸é¢åæï¼æ¬ç¶²ç«ä¸æå°åäººè³æç¨æ¼å ¶ä»ç¨éã <br> æ¬ç¶²ç«å¨æ¨ä½¿ç¨æåä¿¡ç®±ãåå·èª¿æ¥çäºåæ§åè½æï¼æä¿çæ¨ææä¾çå§åãé»åéµä»¶å°åãè¯çµ¡æ¹å¼åä½¿ç¨æéçã <br> æ¼ä¸è¬ç覽æï¼ä¼ºæå¨æèªè¡è¨éç¸éè¡å¾ï¼å æ¬æ¨ä½¿ç¨é£ç·è¨åçIPä½åãä½¿ç¨æéã使ç¨çç覽å¨ãç覽åé»é¸è³æè¨éçï¼åçºæåå¢é²ç¶²ç«æåçåèä¾æï¼æ¤è¨éçºå §é¨æç¨ï¼æ±ºä¸å°å¤å ¬ä½ã <br> çºæä¾ç²¾ç¢ºçæåï¼æåæå°æ¶éçåå·èª¿æ¥å §å®¹é²è¡çµ±è¨èåæï¼åæçµæä¹çµ±è¨æ¸ææèªªææååç¾ï¼é¤ä¾å §é¨ç ç©¶å¤ï¼æåæè¦éè¦å ¬ä½çµ±è¨æ¸æå說ææåï¼ä½ä¸æ¶åç¹å®å人ä¹è³æã <br> <br> <div class='policy_title2'>ä¸ãè³æä¹ä¿è·</div> æ¬ç¶²ç«ä¸»æ©åè¨æé²ç«çã鲿¯ç³»çµ±çç¸éçåé è³è¨å®å ¨è¨ååå¿ è¦çå®å ¨é²è·æªæ½ï¼å 以ä¿è·ç¶²ç«åæ¨çåäººè³ææ¡ç¨å´æ ¼çä¿è·æªæ½ï¼åªç±ç¶éææ¬çäººå¡æè½æ¥è§¸æ¨çåäººè³æï¼ç¸éèç人å¡çç°½æä¿å¯åç´ï¼å¦æéåä¿å¯ç¾©åè ï¼å°æåå°ç¸éçæ³å¾èåã <br> å¦å æ¥åéè¦æå¿ è¦å§è¨å ¶ä»å®ä½æä¾æåæï¼æ¬ç¶²ç«äº¦æå´æ ¼è¦æ±å ¶éµå®ä¿å¯ç¾©åï¼ä¸¦ä¸æ¡åå¿ è¦æª¢æ¥ç¨åºä»¥ç¢ºå®å ¶å°ç¢ºå¯¦éµå®ã <br> <br> <div class='policy_title2'>åãç¶²ç«å°å¤çç¸éé£çµ</div> æ¬ç¶²ç«çç¶²é æä¾å ¶ä»ç¶²ç«ç網路é£çµï¼æ¨ä¹å¯ç¶ç±æ¬ç¶²ç«ææä¾çé£çµï¼é»é¸é²å ¥å ¶ä»ç¶²ç«ãä½è©²é£çµç¶²ç«ä¸é©ç¨æ¬ç¶²ç«çé±ç§æ¬ä¿è·æ¿çï¼æ¨å¿ é åè該é£çµç¶²ç«ä¸çé±ç§æ¬ä¿è·æ¿çã <br> <br> <div class='policy_title2'>äºãè第ä¸äººå ±ç¨åäººè³æä¹æ¿ç</div> æ¬ç¶²ç«çµä¸ææä¾ã交æãåºç§æåºå®ä»»ä½æ¨çåäººè³æçµ¦å ¶ä»å人ãåé«ãç§äººä¼æ¥æå ¬åæ©éï¼ä½ææ³å¾ä¾ææåç´ç¾©åè ï¼ä¸å¨æ¤éã <br> <br> åé 使¸ä¹æ å½¢å æ¬ä¸éæ¼ï¼ <br> <br> ç¶ç±æ¨æ¸é¢åæã <br> æ³å¾ææè¦å®ã <br> çºå 餿¨çå½ã身é«ãèªç±æè²¡ç¢ä¸ä¹å±éªã <br> èå ¬åæ©éæå¸è¡ç ç©¶æ©æ§åä½ï¼åºæ¼å ¬å ±å©ççºçµ±è¨æå¸è¡ç ç©¶èæå¿ è¦ï¼ä¸è³æç¶éæä¾è èçæèéè ä¾å ¶æé²æ¹å¼ç¡å¾èå¥ç¹å®ä¹ç¶äºäººã <br> ç¶æ¨å¨ç¶²ç«çè¡çºï¼éåæåæ¢æ¬¾æå¯è½æå®³æå¦¨ç¤ç¶²ç«èå ¶ä»ä½¿ç¨è æ¬çæå°è´ä»»ä½äººéåæå®³æï¼ç¶ç¶²ç«ç®¡çå®ä½ç ææé²æ¨çåäººè³ææ¯çºäºè¾¨èãè¯çµ¡ææ¡åæ³å¾è¡åæå¿ è¦è ã <br> æå©æ¼æ¨çæ¬çã <br> æ¬ç¶²ç«å§è¨å» ååå©èéãèçæå©ç¨æ¨çåäººè³ææï¼å°å°å§å¤å» åæå人åç¡ç£ç£ç®¡çä¹è²¬ã <br> <br> <div class='policy_title2'>å ãCookieä¹ä½¿ç¨</div> çºäºæä¾æ¨æä½³çæåï¼æ¬ç¶²ç«æå¨æ¨çé»è ¦ä¸æ¾ç½®ä¸¦åç¨æåçCookieï¼è¥æ¨ä¸é¡æ¥åCookieçå¯«å ¥ï¼æ¨å¯å¨æ¨ä½¿ç¨çç覽å¨åè½é ä¸è¨å®é±ç§æ¬çç´çºé«ï¼å³å¯æçµCookieçå¯«å ¥ï¼ä½å¯è½æå°è´ç¶²ç«æäºåè½ç¡æ³æ£å¸¸å·è¡ ã<br> <br> <div class='policy_title2'>ä¸ãé±ç§æ¬ä¿è·æ¿çä¹ä¿®æ£</div> æ¬ç¶²ç«é±ç§æ¬ä¿è·æ¿çå°å æéæ±é¨æé²è¡ä¿®æ£ï¼ä¿®æ£å¾çæ¢æ¬¾å°åç»æ¼ç¶²ç«ä¸ã <br> <div class='policy_page_bottom'> <input type='button' value='éé' name='Close' class='policy_btn close_WindowBtn'> </div> </div> </div> </div> </article> <article class='policy_LinkBlank'> <div class='policy_LinkWindow'> <div class='policy_wp'> <div class='policy_title3'>é±ç§æ¬æ¿çè²æ</div> <p>çºéå°æä½³çç覽é«é©ï¼æ¬ç¶²ç«ä½¿ç¨cookiesï¼è¥æ¨ç¹¼çºç覽æ¬ç¶²ç«ä»£è¡¨æ¨åææåçé±ç§æ¬æ¿çã</p> <div class='flexSB'> <a href='javascript:' class='policy_link window_OpenLink'> Learn more</a> <input type='button' value='好' name='Agree' class='policy_btn agree_btn'> </div> </div> </div> </article>" 1706 ) 1707 1708 //è±æçé±ç§æ¬æ¿ç 1709 $(".block-policy--en").html( 1710 " <article class='policy_page'> <div class='policy_pageBlank'> <div class='policy_wp'> <div class='policy_content'> <div class='policy_title1'>Privacy Statement</div> <div>This page informs you of our policies regarding the collection, use, and disclosure of personal data when you use our Service and the choices you have associated with that data. </div> <div>We may use your data in improving the user experience. By using the website and the service, you agree the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, accessible from </div> <div class='policy_part'> <div class='policy_title2'>Information Collection and Use</div> <div>We collect different types of information for various purposes to provide and improve our Website to you.</div> </div> <div class='policy_part'> <div class='policy_title2'>Types of Data Collected</div> <br/> <h5>(a)Personal Data</h5> <div>When you fill the 'Contact Us' form in our website, you provide us with certain personally identifiable information that can be used to contact or identify you ('Personal Data'). Personal Data be stored only if you choose to submit it to us. </div> <div>Personally identifiable information may include, but is not limited to: </div> <ul> <li>Email address</li> <li>First name and last name</li> <li>Phone number</li> <li>Address, state, province, ZIP/postal code, city and country</li> </ul> <hr> <h5>(b)Usage Data</h5> <div>
1710We may also collect information on how the Website is accessed and used ('Usage Data'). This Usage Data may include information such as your computer's Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Website that you visit, the time and date of your visit, the time spent on those pages, unique device identifiers and other diagnostic data. </div> <hr> <h5>(c)Tracking Cookies Data</h5> <div>Cookies are small files stored on your desktop, laptop or mobile device by websites visited by you. They enable us to e.g. recognize whether there has been a previous connection between your device and our websites, take into account your preferred language or other settings, offer you certain functionalities or recognize your interests on the basis of previous use. Cookies can also contain personal information.</div> </div> <div class='policy_part'> <div>You can also visit our websites without consenting to the use of cookies by such use. In other words, you can reject the use of cookies and delete them at any time by making the appropriate settings to your device. </div> </div> <div class='policy_part'> <div class='policy_title2'>Examples of Cookies we use:</div> <ul> <li><strong>Session Cookies: </strong>We use Session Cookies to operate our Service.</li> <li><strong>Preference Cookies: </strong>We use Preference Cookies to remember your preferences and various settings.</li> <li><strong>Security Cookies: </strong>We use Security Cookies for security purposes.</li> </ul> </div> <div class='policy_part'> <div class='policy_title2'>Use of Data</div> <div>We uses the collected data for various purposes:</div> <ul> <li>To provide and maintain the Website.</li> <li>To notify you about changes to our Website.</li> <li>To allow you to participate in interactive features of our Website when you choose to do so.</li> <li>To provide customer care and support.</li> <li>To provide analysis or valuable information so that we can improve our Website to you.</li> <li>To monitor the usage of the Website.</li> <li>To detect, prevent and address technical issues.</li> </ul> </div> <div class='policy_part'> <div class='policy_title2'>Transfer of Data</div> <div>Your information, including Personal Data, may be transferred to â and maintained on â computers located outside of your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from your jurisdiction. </div> <div>If you are located outside Taiwan and choose to provide information to us, please note that we transfer the data, including Personal Data, to Taiwan and process it there.</div> <div>Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer. </div> <div>We will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of your data and other personal information.</div> </div> <div class='policy_part'> <div class='policy_title2'>Disclosure of Data</div> <div>We may disclose your Personal Data in the good faith belief that such action is necessary to:</div> <ul> <li>To comply with a legal obligation.</li> <li>To protect and defend the rights or property of We.</li> <li>To prevent or investigate possible wrongdoing in connection with the Website.</li> <li>To protect the personal safety of users of the Website or the public.</li> <li>To protect against legal liability.</li> </ul> </div> <div class='policy_part'> <div class='policy_title2'>Security of Data</div> <div>The security of your data is important to us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security. </div> </div> <div class='policy_part'> <div class='policy_title2'>Third Party Service Providers</div> <div>We may employ third party companies and individuals to facilitate our Service ('Service Providers'), to provide the Service on our behalf, to perform Service-related services or to assist us in analyzing how our Website is used. </div> <div>These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose. </div> </div> <div class='policy_part'> <div class='policy_title2'>Links to Other Sites</div> <div>Our Service may contain links to other sites, including sites provided by social media service providers, that are not operated by us. If you click on a third party link, you will be directed to that third party's site. We strongly advise you to review the Privacy Policy of every site you visit.</div> <div>We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.</div> </div> <div class='policy_part'> <div class='policy_title2'>Right to Information, Correction, Deletion and Blocking of Data</div> <div>You have the right to be informed at any time about your personal data, free of charge, if you request that any incorrect information to be corrected, and any personal data should be deleted and blocked. </div> </div> <div class='policy_part'> <div class='policy_title2'>Changes to This Privacy Policy</div> <div>We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page. </div> <div>You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.</div> </div> <div><strong>Contact Us</strong><br/>If you have any questions about this Privacy Policy, please contact us. </div> <div>This Privacy Policy is updated on <strong>May. 10. 2021</strong>.</div> <div class='policy_page_bottom'> <input type='button' value='Close' name='Close' class='policy_btn close_WindowBtn'> </div> </div> </div> </div> </article> <article class='policy_LinkBlank'> <div class='policy_LinkWindow'> <div class='policy_wp'> <div class='policy_title3'>Privacy Statement</div> <div>We use cookies to improve our website, to make it easier for users to operate and to continuously upgrade. By continuing to use this page, you agree to the use of cookies.</p> <div class='flexSB'> <a href='javascript:' class='policy_link window_OpenLink'>Learn more</a> <input type='button' value='Agree' name='Agree' class='policy_btn agree_btn'></div> </div> </div> </article>" 1711 ) 1712 1713 //使ç¨cookie夿· è¿ææ¯å¦ææéåæ 1714 if (getCookieByName("privacy") === "true") {} else { 1715 $("#block-policy").show() 1716 $(".policy_btn.agree_btn").click(function() { 1717 document.cookie = "privacy=true; max-age=259200; path=/;" 1718 }) 1719 } 1720 1721 //é±ç§æ¬è¦çª 1722 $(".agree_btn").click(function() { 1723 $(".policy_LinkBlank").css("display", "none") 1724 }) 1725 $(".window_OpenLink").click(function() { 1726 $(".policy_LinkBlank").css("display", "none") 1727 $(".policy_pageBlank").css("display", "block") 1728 $("body").addClass("blackBg") 1729 // $("body").find('.policy_content').niceScroll({ cursorcolor: "#00A4EA", background: "#EFEFEF", cursorborder: "0.5px solid #00A4EA" }); 1730 }) 1731 $(".close_WindowBtn").click(function() { 1732 $(".policy_pageBlank").css("display", "none") 1733 $("body").removeClass("blackBg") 1734 }) 1735 //夿·ææ©ççæ¹å(ç´å¼èæ©«å¼) 1736 // window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function() { 1737 // if (window.orientation === 90 || window.orientation === -90) { 1738 // $('.policy_content').css('max-height', '200px');
1739 // $('.policy_pageBlank').css('height', '280px'); 1740 // //ç®åè¢å¹çºæ©«åï¼ 1741 // } 1742 // if (window.orientation === 180 || window.orientation === 0) { 1743 // $('.policy_content').css('max-height', '350px'); 1744 // $('.policy_pageBlank').css('height', '430px'); 1745 // //ç®åè¢å¹çºç¸±åï¼ 1746 // } 1747 // }, false); 1748} 1749 1750// function niceScroll_initial() { 1751// $('html').niceScroll({ 1752// cursorcolor: "#054786", 1753// scrollspeed: 40, // 滾åæé 1754// mousescrollstep: 45, // 滾åé度 1755// cursorwidth: "8px" 1756// }); 1757// } 1758 1759function recaptchaAlert() { 1760 alert("è«å¾é¸æä¸æ¯æ©å¨äººé©èï¼è¬è¬ï¼") 1761} 1762 1763//åå®¶åè¡¨ä¸æé¸å® 1764function SelectCountryLoad() { 1765 var countrylist = ` 1766 <option value='AD'>å®éç¾ Andorra</option> 1767 <option value='AE'>é¿æä¼¯è¯åå¤§å ¬å United Arab Emirates</option> 1768 <option value='AF'>é¿å¯æ± Afghanistan</option> 1769 <option value='AG'>å®å°å¡å·´å¸é Antigua and Barbuda</option> 1770 <option value='AI'>å®åæ Anguilla</option> 1771 <option value='AL'>é¿ç¾å·´å°¼äº Albania</option> 1772 <option value='AM'>äºç¾å°¼äº Armenia</option> 1773 <option value='AN'>è·å±¬å®å°åæ¯ Netherlands Antilles</option> 1774 <option value='AO'>å®å¥æ Angola</option> 1775 <option value='AQ'>忥µæ´² Antarctica</option> 1776 <option value='AR'>é¿æ ¹å»· Argentina</option> 1777 <option value='AS'>ç¾å±¬è©æ©äº American Samoa</option> 1778 <option value='AT'>奧å°å© Austria</option> 1779 <option value='AU'>澳大å©äº Australia</option> 1780 <option value='AW'>é¿é¯å·´ Aruba</option> 1781 <option value='AX'>奧è群島 à land Islands</option> 1782 <option value='AZ'>äºå¡æç¶ Azerbaijan</option> 1783 <option value='BA'>波士尼äºèµ«å¡å¥ç¶ç´ Bosnia and Herzegovina</option> 1784 <option value='BB'>å·´è²å¤ Barbados</option> 1785 <option value='BD'>åå æ Bangladesh</option> 1786 <option value='BE'>æ¯å©æ Belgium</option> 1787 <option value='BF'>å¸åç´æ³ç´¢ Burkina Faso</option> 1788 <option value='BG'>ä¿å å©äº Bulgaria</option> 1789 <option value='BH'>å·´æ Bahrain</option> 1790 <option value='BI'>è²éå° Burundi</option> 1791 <option value='BJ'>è²å Benin</option> 1792 <option value='BM'>ç¾æ é Bermuda</option> 1793 <option value='BN'>æ±¶è Brunei Darussalam</option> 1794 <option value='BO'>ç»å©ç¶äº Bolivia</option> 1795 <option value='BR'>巴西 Brazil</option> 1796 <option value='BS'>å·´å馬 Bahamas</option> 1797 <option value='BT'>ä¸ä¸¹ Bhutan</option> 1798 <option value='BV'>æ³¢ç¶ç¹å³¶ Bouvet Island</option> 1799 <option value='BW'>æ³¢æé£ Botswana</option> 1800 <option value='BY'>ç½ä¿ç¾ æ¯ Belarus</option> 1801 <option value='BZ'>è²éæ¯ Belize</option> 1802 <option value='CA'>å æ¿å¤§ Canada</option> 1803 <option value='CC'>å¯å¯æ¯ç¾¤å³¶ Cocos (Keeling) Islands</option> 1804 <option value='CD'>åææ°ä¸»å ±åå The Democratic Republic of The Congo</option> 1805 <option value='CF'>ä¸éå ±åå Central African Republic</option> 1806 <option value='CG'>åæ Congo</option> 1807 <option value='CH'>ç士 Switzerland</option> 1808 <option value='CI'>è±¡çæµ·å²¸ Côte D'Ivoire</option> 1809 <option value='CK'>庫å 群島 Cook Islands</option> 1810 <option value='CL'>æºå© Chile</option> 1811 <option value='CM'>å麥é Cameroon</option> 1812 <option value='CN'>ä¸å China</option> 1813 <option value='CO'>å¥å«æ¯äº Colombia</option> 1814 <option value='CR'>奿¯å¤§é»å Costa Rica</option> 1815 <option value='CU'>å¤å·´ Cuba</option> 1816 <option value='CV'>ç¶å¾·è§ Cape Verde</option> 1817 <option value='CX'>èèªå³¶ Christmas Island</option> 1818 <option value='CY'>è³½æ®åæ¯ Cyprus</option> 1819 <option value='CZ'>æ·å Czech Republic</option> 1820 <option value='DE'>å¾·å Germany</option> 1821 <option value='DJ'>åå¸å° Djibouti</option> 1822 <option value='DK'>丹麥 Denmark</option> 1823 <option value='DM'>å¤ç±³å°¼å Dominica</option> 1824 <option value='DO'>夿尼å Dominican Republic</option> 1825 <option value='DZ'>é¿ç¾åå©äº Algeria</option> 1826 <option value='EC'>åçå¤ Ecuador</option> 1827 <option value='EE'>ææ²å°¼äº Estonia</option> 1828 <option value='EG'>åå Egypt</option> 1829 <option value='EH'>西æåæ Western Sahara</option> 1830 <option value='ER'>åå©åäº Eritrea</option> 1831 <option value='ES'>西çç Spain</option> 1832 <option value='ET'>衣索æ¯äº Ethiopia</option> 1833 <option value='FI'>è¬è Finland</option> 1834 <option value='FJ'>ææ¿ Fiji</option> 1835 <option value='FK'>ç¦å è群島 Falkland Islands (Malvinas)</option> 1836 <option value='FM'>å¯å ç¾ å°¼è¥¿äºè¯é¦ Federated States of Micronesia</option> 1837 <option value='FO'>æ³ç¾ 群島 Faroe Islands</option> 1838 <option value='FR'>æ³å France</option> 1839 <option value='GA'>å å½ Gabon</option> 1840 <option value='GB'>è±å United Kingdom</option> 1841 <option value='GD'>æ ¼çé£é Grenada</option> 1842 <option value='GE'>嬿²»äº Georgia</option> 1843 <option value='GF'>æ³å±¬åäºé£ French Guiana</option> 1844 <option value='GG'>æ ¹æ¯ Guernsey</option> 1845 <option value='GH'>è¿¦ç´ Ghana</option> 1846 <option value='GI'>ç´å¸ç¾ é Gibraltar</option> 1847 <option value='GL'>æ ¼éµè Greenland</option> 1848 <option value='GM'>çæ¯äº Gambia</option> 1849 <option value='GN'>å¹¾å §äº Guinea</option> 1850 <option value='GP'>å¥å¾·æ´æ® Guadeloupe</option> 1851 <option value='GQ'>赤éå¹¾å §äº Equatorial Guinea</option> 1852 <option value='GR'>å¸è Greece</option> 1853 <option value='GS'>å嬿²»äºåæ¡å¨å¥ç¾¤å³¶ South Georgia and The South Sandwich Islands</option> 1854 <option value='GT'>çå°é¦¬æ Guatemala</option> 1855 <option value='GU'>éå³¶ Guam</option> 1856 <option value='GW'>å¹¾å §äºæ¯ç´¢ Guinea-Bissau</option> 1857 <option value='GY'>èäºé£ Guyana</option> 1858 <option value='HK'>馿¸¯ Hong Kong</option> 1859 <option value='HM'>赫德麥ç¶å群島 Heard Island and Mcdonald Islands</option> 1860 <option value='HN'>å®é½ææ¯ Honduras</option> 1861 <option value='HR'>å ç¾ åè¥¿äº Croatia</option> 1862 <option value='HT'>æµ·å° Haiti</option> 1863 <option value='HU'>åçå© Hungary</option> 1864 <option value='ID'>å°å°¼ Indonesia</option> 1865 <option value='IE'>æç¾è Ireland</option> 1866 <option value='IL'>以è²å Israel</option> 1867 <option value='IM'>æ¼å³¶ Isle of Man</option> 1868 <option value='IN'>å°åº¦ India</option> 1869 <option value='IO'>è±å±¬å°åº¦æ´å°å British Indian Ocean Territory</option> 1870 <option value='IQ'>伿å Iraq</option> 1871 <option value='IR'>
1871伿 Islamic Republic of Iran</option> 1872 <option value='IS'>å°å³¶ Iceland</option> 1873 <option value='IT'>ç¾©å¤§å© Italy</option> 1874 <option value='JE'>澤西 Jersey</option> 1875 <option value='JM'>çè²·å Jamaica</option> 1876 <option value='JO'>ç´æ¦ Jordan</option> 1877 <option value='JP'>æ¥æ¬ Japan</option> 1878 <option value='KE'>è¯äº Kenya</option> 1879 <option value='KG'>åç¾åæ¯ Kyrgyzstan</option> 1880 <option value='KH'>æ¬å寨 Cambodia</option> 1881 <option value='KI'>åéå·´æ¯ Kiribati</option> 1882 <option value='KM'>èæ© Comoros</option> 1883 <option value='KN'>èå 鿝å¤ç¦ Saint Kitts and Nevis</option> 1884 <option value='KP'>åé Democratic People's Republic of Korea</option> 1885 <option value='KR'>åé Republic of Korea</option> 1886 <option value='KW'>ç§å¨ç¹ Kuwait</option> 1887 <option value='KY'>éæ¼ç¾¤å³¶ Cayman Islands</option> 1888 <option value='KZ'>åè©å Kazakhstan</option> 1889 <option value='LA'>寮å Lao People's Democratic Republic</option> 1890 <option value='LB'>é»å·´å«© Lebanon</option> 1891 <option value='LC'>èé²è¥¿äº Saint Lucia</option> 1892 <option value='LI'>åæ¯æ¦æ¯ç» Liechtenstein</option> 1893 <option value='LK'>æ¯éèå¡ Sri Lanka</option> 1894 <option value='LR'>è³´æ¯çäº Liberia</option> 1895 <option value='LS'>è³´ç´¢æ Lesotho</option> 1896 <option value='LT'>ç«é¶å® Lithuania</option> 1897 <option value='LU'>ç§æ£®å ¡ Luxembourg</option> 1898 <option value='LV'>æè«ç¶äº Latvia</option> 1899 <option value='LY'>婿¯äº Libyan Arab Jamahiriya</option> 1900 <option value='MA'>æ©æ´å¥ Morocco</option> 1901 <option value='MC'>æ©ç´å¥ Monaco</option> 1902 <option value='MD'>æ©ç¾å¤ç¦ Republic of Moldova</option> 1903 <option value='ME'>èç¹å §å¥ç¾ Montenegro</option> 1904 <option value='MG'>馬éå æ¯å Madagascar</option> 1905 <option value='MH'>馬紹ç¾ç¾¤å³¶ Marshall Islands</option> 1906 <option value='MK'>é¦¬å ¶é Republic of Macedonia</option> 1907 <option value='ML'>é¦¬å© Mali</option> 1908 <option value='MM'>ç·¬ç¸ Myanmar</option> 1909 <option value='MN'>èå¤ Mongolia</option> 1910 <option value='MO'>æ¾³é Macao</option> 1911 <option value='MP'>å馬éäºç´ç¾¤å³¶ Northern Mariana Islands</option> 1912 <option value='MQ'>馬ä¸å°¼å Martinique</option> 1913 <option value='MR'>è å©å¡å°¼äº Mauritania</option> 1914 <option value='MS'>èç¹è²æ Montserrat</option> 1915 <option value='MT'>馬ç¾ä» Malta</option> 1916 <option value='MU'>模éè¥¿æ¯ Mauritius</option> 1917 <option value='MV'>馬ç¾å°å¤« Maldives</option> 1918 <option value='MW'>馬æå¨ Malawi</option> 1919 <option value='MX'>å¢¨è¥¿å¥ Mexico</option> 1920 <option value='MY'>馬ä¾è¥¿äº Malaysia</option> 1921 <option value='MZ'>è«ä¸æ¯å Mozambique</option> 1922 <option value='NA'>ç´ç±³æ¯äº Namibia</option> 1923 <option value='NC'>æ°åéå¤å°¼äº New Caledonia</option> 1924 <option value='NE'>å°¼æ¥ Niger</option> 1925 <option value='NF'>諾ç¦å å³¶ Norfolk Island</option> 1926 <option value='NG'>å¥åå©äº Nigeria</option> 1927 <option value='NI'>å°¼å æç Nicaragua</option> 1928 <option value='NL'>è·è Netherlands</option> 1929 <option value='NO'>æªå¨ Norway</option> 1930 <option value='NP'>å°¼æ³ç¾ Nepal</option> 1931 <option value='NR'>è«¾é¯ Nauru</option> 1932 <option value='NU'>ç´å Niue</option> 1933 <option value='NZ'>ç´è¥¿è New Zealand</option> 1934 <option value='OM'>é¿æ¼ Oman</option> 1935 <option value='PA'>å·´æ¿é¦¬ Panama</option> 1936 <option value='PE'>ç§é¯ Peru</option> 1937 <option value='PF'>æ³å±¬æ³¢éå°¼è¥¿äº French Polynesia</option> 1938 <option value='PG'>å·´å¸äºç´å¹¾å §äº Papua New Guinea</option> 1939 <option value='PH'>è²å¾è³ Philippines</option> 1940 <option value='PK'>å·´åºæ¯å¦ Pakistan</option> 1941 <option value='PL'>æ³¢è Poland</option> 1942 <option value='PM'>èç®è¶å¯å é Saint Pierre and Miquelon</option> 1943 <option value='PN'>ç®ç¹åº· Pitcairn</option> 1944 <option value='PR'>æ³¢å¤é»å Puerto Rico</option> 1945 <option value='PS'>å·´åæ¯å¦ Palestinian Territory, Occupied</option> 1946 <option value='PT'>è¡èç Portugal</option> 1947 <option value='PW'>å¸ç Palau</option> 1948 <option value='PY'>å·´æå Paraguay</option> 1949 <option value='QA'>å¡é Qatar</option> 1950 <option value='RE'>çå°¼æº Réunion</option> 1951 <option value='RO'>ç¾ é¦¬å°¼äº Romania</option> 1952 <option value='RS'>å¡ç¾ç¶äº Serbia</option> 1953 <option value='RU'>ä¿ç¾ æ¯ Russian Federation</option> 1954 <option value='RW'>ç§å®é Rwanda</option> 1955 <option value='SA'>æ²çå°é¿æä¼¯ Saudi Arabia</option> 1956 <option value='SB'>ç´¢ç¾ é群島 Solomon Islands</option> 1957 <option value='SC'>å¡å¸ç¾ Seychelles</option> 1958 <option value='SD'>è丹 Sudan</option> 1959 <option value='SE'>çå ¸ Sweden</option> 1960 <option value='SG'>æ°å å¡ Singapore</option> 1961 <option value='SH'>èèµ«åæ¿ Saint Helena</option> 1962 <option value='SI'>æ¯æ´ç¶å°¼äº Slovenia</option> 1963 <option value='SJ'>æ¯ç¦ç¾å·´å°æ£ Svalbard and Jan Mayen</option> 1964 <option value='SK'>æ¯æ´ä¼å Slovakia</option> 1965 <option value='SL'>ç åå±± Sierra Leone</option> 1966 <option value='SM'>è馬å©è«¾ San Marino</option> 1967 <option value='SN'>å¡å §å ç¾ Senegal</option> 1968 <option value='SO'>索馬å©äº Somalia</option> 1969 <option value='SR'>èå©å Suriname</option> 1970 <option value='ST'>èå¤ç¾æ®æè¥¿æ¯ Sao Tome and Principe</option> 1971 <option value='SV'>è©ç¾ç¦å¤ El Salvador</option> 1972 <option value='SY'>æå©äº Syrian Arab Republic</option> 1973 <option value='SZ'>å²ç¦æ¿è Swaziland</option> 1974 <option value='TC'>æå æ¯å¯å æ¯ç¾¤å³¶ Turks and Caicos Islands</option> 1975 <option value='TD'>æ¥å¾· Chad</option> 1976 <option value='TF'>æ³å±¬åé¨å±¬å° French Southern Territories</option> 1977 <option value='TG'>å¤å¥ Togo</option> 1978 <option value='TH'>æ³°å Thailand</option> 1979 <option value='TJ'>å¡åå Tajikistan</option> 1980 <option value='TK'>æå å Tokelau</option> 1981 <option value='TL'>æ±å¸æ±¶ Timor-Leste</option> 1982 <option value='TM'>ååº«æ¼ Turkmenistan</option> 1983 <option value='TN'>çªå°¼è¥¿äº Tunisia</option> 1984 <option value='TO'>æ±å Tonga</option> 1985 <option value='TR'>åè³å ¶ Turkey</option> 1986 <option value='TT'>åééæè²å¥ Trinidad and Tobago</option> 1987 <option value='TV'>åç¦é¯ Tuvalu</option> 1988 <option value='TW'>å°ç£ Taiwan (ROC)</option> 1989 <option value='TZ'>å¦å°å°¼äº Tanzania</option> 1990 <option value='UA'>çå è Ukraine</option> 1991 <option value='UG'>çå¹²é Uganda</option> 1992 <option value='UM'>ç¾å±¬éç群島 United States Minor Outlying Islands</option> 1993 <option value='US'>ç¾å United States</option> 1994 <option value='UY'>çæå Uruguay</option> 1995 <option value='UZ'>çè²å¥å Uzbekistan</option> 1996 <option value='VA'>æå»·(梵è岡) Holy See (Vatican City State)</option> 1997 <option value='VC'>èææ£® Saint Vincent and The Grenadines</option> 1998 <option value='VE'>å§å §çæ Venezuela</option> 1999 <option value='VG'>è±å±¬ç¶ç¾äº¬ç¾¤å³¶ Virgin Islands, British</option> 2000 <option value='VI'>ç¾å±¬ç¶äº¬ç¾¤å³¶ Virgin Islands, U.S.</option> 2001 <option value='VN'>è¶å Viet Nam</option> 2002 <option value='VU'>è¬é£æ Vanuatu</option> 2003 <option value='WF'>è¯éæ¯ç¦ä»ç´ Wallis and Futuna</option> 2004 <option value='WS'>è©æ©äº Samoa</option> 2005 <option value='YE'>èé Yemen</option> 2006 <option value='YT'>ç¾äºç¹ Mayotte</option> 2007 <option value='ZA'>åé South Africa</option> 2008 <option value='ZM'>å°æ¯äº Zambia</option> 2009 <option value='ZW'>è¾å·´å¨ Zimbabwe</option> 2010 ` 2011 $("#js-globalcountry").append(countrylist) 2012} 2013 2014function safariHacks() { 2015 2016 DefineVh = function() { 2017 let windowsVH = window.innerHeight / 100; 2018 // console.log(windowsVH) 2019 document.querySelector('body').style.setProperty('--vh', windowsVH + 'px'); 2020 } 2021 $(document).ready(function() { 2022 DefineVh() 2023 // window.addEventListener('resize', function() { 2024 // DefineVh() 2025 // }); 2026 }) 2027 2028} 2029 2030function copyrightYear() { 2031 var today = new Date() 2032 var year = today.getFullYear() 2033 $('#copyrightYear').text(year) 2034} 2035 2036if ($currentpage != "GUIDELINE") { 2037 // 黿aé£ææ»¾åé é¢ 2038 // $("a").on('click', function(event) { 2039 // /* Make sure this.hash has a value before overriding default behavior */ 2040 // if (this.hash !== "" && this.hash !== "#!") { 2041 // /* Prevent default anchor click behavior */ 2042 // event.preventDefault(); 2043 // /* Store hash */ 2044 // var hash = this.hash; 2045 // /* Using jQuery's animate() method to add smooth page scroll*/ 2046 // /* The optional number (800) specifies the number of milliseconds it takes to
2046scroll to the specified area*/ 2047 // $('html, body').animate({ 2048 // scrollTop: $(hash).offset().top 2049 // }, 800, function() { 2050 // /* Add hash (#) to URL when done scrolling (default click behavior)*/ 2051 // window.location.hash = hash; 2052 // }); 2053 // } /* End if */ 2054 // }); 2055} 2056 2057function Tenpercentile_productbox() { 2058 //productbox 广 ¼æ¬ä½ 2059 $('.productbox').each(function() { 2060 var $old = $(this).find('.productbox__oldprice span') 2061 var $new = $(this).find('.productbox__newprice span') 2062 2063 var formatPriceText = function(txt) { 2064 if (txt == null) return '' 2065 var str = String(txt).trim() 2066 // åé广 ¼ï¼åææ ¼å¼åå·¦å³å ©ç«¯ 2067 if (str.indexOf('~') !== -1) { 2068 var parts = str.split('~') 2069 var left = parts[0] != null ? parts[0].trim() : '' 2070 var right = parts[1] != null ? parts[1].trim() : '' 2071 var leftNum = parseInt(left.replace(/[^0-9\.-]/g, '')) 2072 var rightNum = parseInt(right.replace(/[^0-9\.-]/g, '')) 2073 if (!isNaN(leftNum) && !isNaN(rightNum)) { 2074 return AppendComma(leftNum) + ' ~ ' + AppendComma(rightNum) 2075 } 2076 // è¥ç¡æ³è§£æçºæ¸åï¼å樣åå³ 2077 return str 2078 } 2079 2080 // å®å¹ï¼æåæ¸åå¾åååä½ï¼è§£æå¤±æå忍£ 2081 var num = parseInt(str.replace(/[^0-9\.-]/g, '')) 2082 if (!isNaN(num)) { 2083 return AppendComma(num) 2084 } 2085 return str 2086 } 2087 2088 $old.text(formatPriceText($old.text())) 2089 $new.text(formatPriceText($new.text())) 2090 }) 2091} 2092 2093function Tenpercentile() { 2094 $('.js-Tenpercentile').each(function() { 2095 $(this).text(AppendComma(parseInt($(this).text()))) 2096 }) 2097} 2098 2099//æ¸åèççºæååä½ 2100function AppendComma(n) { 2101 // https://kevintsengtw.blogspot.com/2011/10/jquery.html 2102 if (n < 0) { 2103 n = '0'; 2104 } 2105 if (!/^((-*\d+)|(0))$/.test(n)) { 2106 var newValue = /^((-*\d+)|(0))$/.exec(n); 2107 if (newValue != null) { 2108 if (parseInt(newValue, 10)) { 2109 n = newValue; 2110 } else { 2111 n = '0'; 2112 } 2113 } else { 2114 n = '0'; 2115 } 2116 } 2117 if (parseInt(n, 10) == 0) { 2118 n = '0'; 2119 } else { 2120 n = parseInt(n, 10).toString(); 2121 } 2122 2123 n += ''; 2124 var arr = n.split('.'); 2125 var re = /(\d{1,3})(?=(\d{3})+$)/g; 2126 // console.log(arr[0].replace(re, '$1,') + (arr.length == 2 ? '.' + arr[1] : '')) 2127 return arr[0].replace(re, '$1,') + (arr.length == 2 ? '.' + arr[1] : ''); 2128} 2129 2130function specboxControl() { 2131 //init 2132 $('.specbox').removeClass('specbox--choose') 2133 // $('.specbox').eq(0).addClass('specbox--choose') 2134 2135 $('.specbox').click(function() { 2136 $(this).siblings('.specbox').removeClass('specbox--choose') 2137 $(this).addClass('specbox--choose') 2138 }) 2139} 2140 2141function discountboxTimeCounting() { 2142 2143 $('.js-timecounter').each(function() { 2144 var that = $(this) 2145 var nowtime = Math.floor(Date.now() / 1000) 2146 var deadtime = that.find('span').text() 2147 var lasttime = deadtime - nowtime 2148 var seconds = 0 2149 var mins = 0 2150 var hours = 0 2151 var days = 0 2152 2153 var define_Time = function() { 2154 seconds = parseInt(lasttime % 60) 2155 mins = parseInt(lasttime / 60 % 60) 2156 hours = parseInt(lasttime / 60 / 60 % 24) 2157 days = parseInt(lasttime / 60 / 60 / 24) 2158 } 2159 define_Time() 2160 2161 //æå°å©é¤æé 2162 var printTime = function() { 2163 if (days == 0) { 2164 that.find('span').text(hours + 'å°æ ' + mins + 'å ' + seconds + 'ç§') 2165 } else { 2166 that.find('span').text(days + '天 ' + hours + 'å°æ ' + mins + 'å ' + seconds + 'ç§') 2167 } 2168 } 2169 2170 //ç§æ¸åæ¸ 2171 var timeCounting = setInterval(() => { 2172 lasttime-- 2173 define_Time() 2174 printTime() 2175 if (lasttime <= 0) { 2176 clearInterval(timeCounting) 2177 that.text('åªæ å·²çµæ') 2178 } 2179 }, 1000) 2180 }) 2181} 2182 2183function openSmallwindow(pageNum) { 2184 $('.smallwindow').addClass('js-smallwindow--open') 2185 $('.screenmask2').addClass('screenmask2--active') 2186 2187 if (pageNum != undefined) { 2188 $('.smallwindow .smallwindow__inner').hide() 2189 $('.smallwindow .smallwindow__inner[data-smallwindowPage="' + pageNum + '"]').show() 2190 } 2191 2192} 2193 2194function closesmallwindow() { 2195 $('.smallwindow').removeClass('js-smallwindow--open') 2196 $('.screenmask2').removeClass('screenmask2--active') 2197 setTimeout(() => { 2198 $('.smallwindow .smallwindow__inner').hide() 2199 $('.smallwindow .smallwindow__inner').eq(0).show() 2200 }, 400) 2201} 2202 2203function smallwindowControl() { 2204 $('.screenmask2').click(function() { 2205 $(this).removeClass('screenmask2--active') 2206 $('.smallwindow').removeClass('js-smallwindow--open') 2207 }) 2208} 2209 2210function openChoosewindow() { 2211 $('.choosewindow').addClass('js-choosewindow--open') 2212 $('.screenmask2').addClass('screenmask2--active') 2213} 2214 2215function closeChoosewindow() { 2216 $('.choosewindow').removeClass('js-choosewindow--open') 2217 $('.screenmask2').removeClass('screenmask2--active') 2218} 2219 2220function choosewindowControl() { 2221 $('.choosewindow__btn-add').click(function() { 2222 $(this).parents('.choosewindow').removeClass('js-choosewindow--open') 2223 $('.screenmask2').removeClass('screenmask2--active') 2224 }) 2225 $('.screenmask2').click(function() { 2226 $(this).removeClass('screenmask2--active') 2227 $('.choosewindow').removeClass('js-choosewindow--open') 2228 }) 2229} 2230 2231function openTipwindow() { 2232 $('.tipwindow').addClass('js-tipwindow--open') 2233 $('.screenmask2').addClass('screenmask2--active') 2234} 2235 2236function tipwindowControl() { 2237 $('.tipwindow__btn').click(function() { 2238 $(this).parents('.tipwindow').removeClass('js-tipwindow--open') 2239 $('.screenmask2').removeClass('screenmask2--active') 2240 }) 2241 $('.screenmask2').click(function() { 2242 $(this).removeClass('screenmask2--active') 2243 $('.tipwindow').removeClass('js-tipwindow--open') 2244 }) 2245} 2246 2247function blockReadyaddControl() { 2248 2249 $('.block-readyadd__toggle').click(function() { 2250 $(this).toggleClass('block-readyadd__toggle--reverse') 2251 $(this).siblings('.block-readyadd__list').slideToggle() 2252 }) 2253 2254} 2255 2256//Sitenav shrink when scrolldown 2257function NavbarStyle() { 2258 $header = $(".main-menu") 2259 $headerBlankSpace = $(".header__blank-space") 2260 isJunbotronExist = $('.swiper-jumbotron').length > 0 2261 2262 // console.log(isJunbotronExist) 2263 // æ²æè¼ªææï¼main-menuä½¿ç¨æåºè²çæ¨£å¼ 2264 if (!isJunbotronExist) { 2265 if (wdth < mediawdth_desktop) { 2266 $header.addClass("main-menu--mobile-style") 2267 $headerBlankSpace.addClass("header__blank-space--style") 2268 } else { 2269 $header.addClass("main-menu--style") 2270 $headerBlankSpace.addClass("header__blank-space--style") 2271 } 2272 } 2273 2274 $(window).on("resize", function() { 2275 if (wdth < mediawdth_desktop) { 2276 if (isJunbotronExist) { 2277 $header.removeClass("main-menu--style") 2278 $headerBlankSpace.removeClass("header__blank-space--style") 2279 } 2280 } else { 2281 if (isJunbotronExist) { 2282 $header.removeClass("main-menu--mobile-style") 2283 $headerBlankSpace.removeClass("header__blank-space--style") 2284 } 2285 } 2286 }) 2287 2288 $(window).on("scroll", function() { 2289 var scrollDistance = $(window).scrollTop() 2290 // ææ©çnavbaré»éæ,å³ä½¿æ²å main-menuä¹ä¸æç¸®å° 2291 if ($(".navitem-group").hasClass("js-navitem-group--open")) {} else { 2292 if (wdth < mediawdth_desktop) { 2293 if (scrollDistance > 500) { 2294 $header.addClass("main-menu--mobile-style") 2295 $headerBlankSpace.addClass("header__blank-space--style") 2296 } else { 2297 if (isJunbotronExist) { 2298 $header.removeClass("main-menu--mobile-style") 2299 $headerBlankSpace.removeClass("header__blank-space--style") 2300 } 2301 } 2302 } else { 2303 if (scrollDistance > 500) { 2304 $header.addClass("main-menu--style") 2305 $headerBlankSpace.addClass("header__blank-space--style") 2306 } else { 2307 if (isJunbotronExist) { 2308 $header.removeClass("main-menu--style") 2309 $headerBlankSpace.removeClass("header__blank-space--style") 2310 } 2311 } 2312 } 2313 } 2314 }) 2315} 2316 2317function removeEmptyParagraphs() { 2318 $('p').each(function() { 2319 var $p = $(this); 2320 if ($p.html().trim() === '<br>') { 2321 $p.remove(); 2322 } 2323 }); 2324} 2325 2326function editorStyleAdjust() { 2327 $('.editor').find('table').each(function() { 2328 $(this).wrap('<div class="u-overxauto"></div>'); 2329 }); 2330} 2331 2332function mMenuToggle() { 2333 $('.m-menuHead__toggle').click(function() { 2334 $(this).closest('.m-menuHead__title').siblings('.m-menuHead__list').slideToggle() 2335 }) 2336}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.