jQuery(document).ready(function($) { "use strict"; //Image scaling var ratio = 150/150; $(".gallery-container .item-content").not(".post-gallery-container .item-content").each(function(){ var rpsWidth = $(this).parents(".gallery-container").find(".item-cover").first().width(); var rpsHeight = rpsWidth * ratio; //$(this).find(".item-cover img").width( rpsWidth ); $(this).find(".item-cover img").height( rpsHeight ); $(this).last().addClass( "highlight" ); }); if( $(window).width() > 480 ){ var maxHeight = Math.max.apply(null, $(".section-thumb-excerpt.grid-col-2 .thumb-excerpt-list li, .section-thumb-excerpt.grid-col-3 .thumb-excerpt-list li").map(function () { return $(this).height(); }).get()); $(".section-thumb-excerpt.grid-col-2 .thumb-excerpt-list li, .section-thumb-excerpt.grid-col-3 .thumb-excerpt-list li").height( maxHeight ); } //HeaderPinned if( $(window).width() > 1023 ){ $(window).scroll(function(){ if($(window).scrollTop() >= 250){ $(".header").addClass("head-pinned"); $(".search-box").addClass("search-pinned"); }else{ $(".header").removeClass("head-pinned"); $(".search-box").removeClass("search-pinned"); } }); } //Homepage - Slideshow $(".slideshow-container").hover(function(){ $(".slideshow-container .swiper-button-prev, .slideshow-container .swiper-container-rtl .swiper-button-next").animate({"left":"30px","right":"auto","opacity":"1"},200).show(); $(".slideshow-container .swiper-button-next, .slideshow-container .swiper-container-rtl .swiper-button-prev").animate({"left":"auto","right":"30px","opacity":"1"},200).show(); },function(){ $(".slideshow-container .swiper-button-prev, .slideshow-container .swiper-container-rtl .swiper-button-next").animate({"left":"-80px","right":"auto","opacity":"0"},200); $(".slideshow-container .swiper-button-next, .slideshow-container .swiper-container-rtl .swiper-button-prev").animate({"left":"auto","right":"-80px","opacity":"0"},200); }); var homeSliderSwiper = new Swiper (".slideshow-container", { effect: "slide", direction: "horizontal", centeredSlides: true, simulateTouch: true, parallax:true, pagination: { el: ".home-slider-swiper-pagination", type: "bullets", clickable:true, }, navigation: { nextEl: ".home-slider-swiper-button-next", prevEl: ".home-slider-swiper-button-prev", }, speed: 1200, autoplay: { delay: 3000, }, loop: true }); if( $(".slideshow-container .swiper-slide").length == 1 || $(".slideshow-container .swiper-slide").length == 3 ) { $(".slideshow-container").addClass( "disabled" ); } //Thumblist - ThumbRadio var ptRadio = 0.75; var ptWidth = $(".post-gallery-container .item-content .item-grid-box .attachment img").width(); var ptHeight = ptWidth * ptRadio; $(".post-gallery-container .item-content .item-grid-box .attachment img").height( ptHeight ); //ThumbExcerptlist - ThumbRadio var trRadio = 0.75; var trWidth = 300; var trHeight = trWidth * trRadio; $(".thumb-excerpt-list li .post-thumbnail img").not(".thumb-title-excerpt-box .thumb-excerpt-list li .post-thumbnail img").width( trWidth ); $(".thumb-excerpt-list li .post-thumbnail img").not(".thumb-title-excerpt-box .thumb-excerpt-list li .post-thumbnail img").height( trHeight ); var thumbWidthVertical = $(".thumb-title-excerpt-box .thumb-excerpt-list li .post-thumbnail").width(); var thumbHeightVertical = thumbWidthVertical * trRadio; $(".thumb-title-excerpt-box .thumb-excerpt-list li .post-thumbnail img").width( thumbWidthVertical ); $(".thumb-title-excerpt-box .thumb-excerpt-list li .post-thumbnail img").height( thumbHeightVertical ); //ImageDelayAnimation var startDelayTime = 50; var addDelayTime = 50; //ImageDelayAnimation - PostGallery $(".gallery-container").each(function(){ $.each($(this).find(".item-content"), function(index, item) { $(item).attr("data-aos-delay", startDelayTime + index * addDelayTime); }); }); //ImageDelayAnimation - PostExcerptThumb $(".thumb-title-list, .thumb-excerpt-list").each(function(){ $.each($(this).find("li"), function(index, item) { $(item).attr("data-aos-delay", startDelayTime + index * addDelayTime); }); }); //ImageDelayAnimation - GridColumn $(".section-editor ul").each(function(){ $.each($(this).find("li"), function(index, item) { $(item).attr("data-aos", "fade-up"); $(item).attr("data-aos-delay", startDelayTime + index * addDelayTime); }); }); //ImageDelayAnimation - PostImages $(".product-content img").not(".gallery img").each(function(index, item) { $(item).addClass("aos-init aos-animate"); $(item).attr("data-aos", "fade-up"); $(item).attr("data-aos-delay", startDelayTime + index * addDelayTime); }); //ImageDelayAnimation - Gallery $(".gallery").each(function(){ $.each($(this).find(".gallery-item"), function(index, item) { $(item).addClass("aos-init aos-animate"); $(item).attr("data-aos", "fade-up"); $(item).attr("data-aos-delay", startDelayTime + index * addDelayTime); }); }); //Widget | CatCarouselPicPosts var thisGallerySlider = []; $(".cat-carousel-gallery-slider").each(function(i){ var thisGallerySliderID = $(this).attr("id"); var thisPaginationID = $(this).find(".gallery-swiper-pagination").attr("id"); var thisPrevButtonID = $(this).parent().find(".gallery-swiper-button-prev").attr("id"); var thisNextButtonID = $(this).parent().find(".gallery-swiper-button-next").attr("id"); thisGallerySlider[i] = new Swiper("#"+thisGallerySliderID, { effect: "slide", direction: "horizontal", slidesPerView: 1, slidesPerGroup: 1, centeredSlides: false, simulateTouch: true, pagination: { el: "#"+thisPaginationID, type: "bullets", clickable:true, }, navigation: { prevEl: "#"+thisPrevButtonID, nextEl: "#"+thisNextButtonID, }, a11y: { prevSlideMessage: "Prev", nextSlideMessage: "Next", paginationBulletMessage: "{{index}}", }, breakpoints: { 321: { slidesPerView: 2, slidesPerGroup: 2, }, 769: { slidesPerView: 4, slidesPerGroup: 4, }, 1024: { slidesPerView: $(this).data("grid"), slidesPerGroup: $(this).data("group"), } }, speed: 800, autoplay: { delay: $(this).data("delay"), disableOnInteraction: false, }, loop: true }); // // thisSwiper[i].on("slideChange", function () { // console.log("slide "+i+" changed"); // }); }); //Widget | GalleryCarousel $(".pop-gallery-slider br, .pop-gallery-slider p").remove(); $(".pop-gallery-slider").find(".gallery").addClass("swiper-wrapper"); $(".pop-gallery-slider").find(".gallery-item").addClass("swiper-slide"); var thisPOPGallerySlider = []; $(".pop-gallery-slider").each(function(i){ var thisPOPGallerySliderID = $(this).attr("id"); var thisPaginationID = $(this).find(".pop-swiper-pagination").attr("id"); var thisPrevButtonID = $(this).parent().find(".pop-swiper-button-prev").attr("id"); var thisNextButtonID = $(this).parent().find(".pop-swiper-button-next").attr("id"); var thisPOPGalleryGrid = $(this).data("grid"); var thisPOPGalleryGroup = $(this).data("group"); if( thisPOPGalleryGrid >= 1 ){ thisPOPGallerySlider[i] = new Swiper("#"+thisPOPGallerySliderID, { effect: "slide", direction: "horizontal", slidesPerView: thisPOPGalleryGrid, loopedSlides: thisPOPGalleryGrid, slidesPerGroup: thisPOPGalleryGrid, spaceBetween: 0, centeredSlides: false, simulateTouch: true, preloadImages: true, pagination: { el: "#"+thisPaginationID, type: "bullets", clickable:true, }, navigation: { prevEl: "#"+thisPrevButtonID, nextEl: "#"+thisNextButtonID, }, a11y: { prevSlideMessage: "Prev", nextSlideMessage: "Next", paginationBulletMessage: "{{index}}", }, breakpoints: { 321: { slidesPerView: 2, slidesPerGroup: 2, }, 769: { slidesPerView: 4, slidesPerGroup: 4, }, 1024: { slidesPerView: thisPOPGalleryGrid, slidesPerGroup: thisPOPGalleryGrid, } }, speed: 1200, autoplay: { delay: $(this).data("delay"), disableOnInteraction: false, }, loop: true }); } else { thisPOPGallerySlider[i] = new Swiper("#"+thisPOPGallerySliderID, { effect: "slide", direction: "horizontal", slidesPerView: thisPOPGalleryGrid, loopedSlides: thisPOPGalleryGrid, slidesPerGroup: thisPOPGalleryGrid, spaceBetween: 0, centeredSlides: true, simulateTouch: true, preloadImages: true, pagination: { el: "#"+thisPaginationID, type: "bullets", clickable:true, }, navigation: { prevEl: "#"+thisPrevButtonID, nextEl: "#"+thisNextButtonID, }, a11y: { prevSlideMessage: "Prev", nextSlideMessage: "Next", paginationBulletMessage: "{{index}}", }, breakpoints: { 321: { slidesPerView: 2, slidesPerGroup: 2, }, 769: { slidesPerView: 4, slidesPerGroup: 4, }, 1024: { slidesPerView: thisPOPGalleryGrid, slidesPerGroup: thisPOPGalleryGrid, } }, speed: 800, /*autoplay: { delay: $(this).data("delay"), disableOnInteraction: false, },*/ loop: true }); } }); //Widget | MultiProductCatTabsGalleryPosts $(".mobile-body .filters-nav-tabs .btn a").click(function(){ return false; }); $(".section-item .section-content").each(function(){ var $title = $(this).find(".filters-nav-tabs .btn"); var $content = $(this).find(".tab-content-box"); $(this).find(".filters-nav-tabs span.btn:first").addClass("btn-cur"); $(this).find(".tab-content-box:not(:first)").addClass("hide"); $title.hover(function(){ var index = $title.index($(this)); $(this).addClass("btn-cur").siblings().removeClass("btn-cur"); $content.hide(); $($content.get(index)).show(); return false; }); }); //Widget | CatCarouselPicPosts $(".cat-carousel-gallery-posts").each(function(){ var ccgpRadio = $(this).find(".section-container").data("radio"); var ccgpWidth = $(this).find(".thumbnail").width(); var ccgpHeight = ccgpWidth * ccgpRadio; $(this).find("img").width( ccgpWidth ); $(this).find("img").height( ccgpHeight ); }); //Widget | CatStickySliderPosts var thisStickySlider = []; $(".cat-sticky-post-slider").each(function(i){ var thisStickySliderID = $(this).attr("id"); var thisPaginationID = $(this).find(".sticky-swiper-pagination").attr("id"); thisStickySlider[i] = new Swiper("#"+thisStickySliderID, { effect: "slide", direction: "horizontal", slidesPerView: 1, slidesPerGroup: 1, centeredSlides: false, simulateTouch: true, pagination: { el: "#"+thisPaginationID, type: "bullets", clickable:true, }, speed: 800, autoplay: { delay: $(this).data("delay"), disableOnInteraction: false, }, loop: true }); }); //Back to top $(window).bind("scroll", function(){ if ($(this).scrollTop() > 200) { $(".back-to-top, .back-to-top-livechat").fadeIn(500).css({display:"inline-block"}); } else { $(".back-to-top, .back-to-top-livechat").fadeOut(500); } }); $(".back-to-top, .back-to-top-livechat").click(function(){ $("html, body").animate({scrollTop: "0px"}, 500); }); //Live chat if( $(window).width() > 1023 ){ $(".live-chat-icon .live-chat-box p, .live-chat-icon .woo-cart-box").hover(function(){ $(this).find("span,strong").animate({ right: "40", opacity:1 }, 300 ); },function(){ $(this).find("span,strong").animate({ right: "-200px", opacity:0 }, 300 ); }); } //Leave a message $(document).click(function(){ $(".message-form-box .message-form").slideUp("fast"); }); $(".message-form-box").click(function(event){ event.stopPropagation(); }); $(".message-header").click( function(){ $(".message-form-box .message-form").slideToggle("fast"); $(".message-form-box").toggleClass("message-form-box-toggle"); $(".message-form-box .message-header .arrow-toggle i").toggleClass("icon-up icon-down"); } ); //Forbidden Mouse Right Click $("body").bind("cut copy paste", function(){ return false; }); //Forbidden Mouse Right Click document.onkeydown = function(e) { if (e.ctrlKey && (e.keyCode === 85 || e.keyCode === 117)) { //alert(""); return false; } else { return true; } }; $(document).keypress("u",function(e) { if(e.ctrlKey){ //alert(""); return false; } else { return true; } }); }); jQuery(document).ready(function($) { 'use strict'; //ThumbExcerptlist - ThumbRadio var glRadio = 0.75; var glWidth = $(".category-certificate .gallery-container .item-grid-box .attachment img").width(); var glHeight = glWidth * glRadio; $(".category-certificate .gallery-container .item-grid-box .attachment img").height( glHeight ); var ztWidth = $(".category-zhuanli .gallery-container .item-grid-box .attachment img").width(); var ztHeight = ztWidth * glRadio; $(".category-zhuanli .gallery-container .item-grid-box .attachment img").height( ztHeight ); // if

is emprty, remove $('.home .section-editor p:empty').remove(); });