Difference between revisions of "Template:BJ101ID/main.js"

(Blanked the page)
 
Line 1: Line 1:
 +
(function(a) {
 +
        a(window).on("scroll", function() {
 +
                if(a(this).scrollTop()>0) {
 +
                    a(".sticky-header").addClass("sticky")
 +
                }
  
 +
                else {
 +
                    a(".sticky-header").removeClass("sticky")
 +
                }
 +
            }
 +
 +
        ); var e=new Swiper(".slider-container.swiper-container", {
 +
                spaceBetween:30, centeredSlides:true, speed:3000, autoplay:false, loop:true, effect:"fade", fadeEffect: {
 +
                    crossFade:true
 +
                }
 +
 +
                , on: {
 +
                    slideChange:function() {
 +
                        var h=this.realIndex+1; document.querySelector(".current-slide").innerHTML=h
 +
                    }
 +
 +
                    , paginationRender:function() {
 +
                        var h=document.getElementsByClassName("swiper-pagination-bullet").length; document.querySelector(".total-slides").innerHTML=h
 +
                    }
 +
                }
 +
            }
 +
 +
        ); var e=new Swiper(".team-carousel .swiper-container", {
 +
                slidesPerView:1, speed:1000, loop:true, spaceBetween:30, autoplay:false, effect:"fade", fadeEffect: {
 +
                    crossFade:true,
 +
                }
 +
 +
                , navigation: {
 +
                    nextEl:".team-carousel .swiper-button-next", prevEl:".team-carousel .swiper-button-prev",
 +
                }
 +
            }
 +
 +
        ); var e=new Swiper(".testimonial-carousel.swiper-container", {
 +
                slidesPerView:1, speed:1000, loop:true, spaceBetween:30, autoplay:true, navigation: {
 +
                    nextEl:".testimonial-carousel .swiper-button-next", prevEl:".testimonial-carousel .swiper-button-prev",
 +
                }
 +
            }
 +
 +
        ); a(".video-popup").magnificPopup( {
 +
                type:"iframe"
 +
            }
 +
 +
        ); a(".header-action-btn-menu").on("click", function() {
 +
                a("body").addClass("fix"); a(".mobile-menu-wrapper").addClass("open")
 +
            }
 +
 +
        ); a(".offcanvas-btn-close,.offcanvas-overlay").on("click", function() {
 +
                a("body").removeClass("fix"); a(".mobile-menu-wrapper").removeClass("open")
 +
            }
 +
 +
        ); var c=a(".mobile-menu, .category-menu"), d=c.find(".dropdown"); d.slideUp(); c.on("click", "li a, li .menu-expand", function(i) {
 +
                var h=a(this); if((h.parent().attr("class").match(/\b(menu-item-has-children|has-children|has-sub-menu)\b/))&&(h.attr("href")==="#"||h.hasClass("menu-expand"))) {
 +
                    i.preventDefault(); if(h.siblings("ul:visible").length) {
 +
                        h.parent("li").removeClass("active"); h.siblings("ul").slideUp()
 +
                    }
 +
 +
                    else {
 +
                        h.parent("li").addClass("active"); h.closest("li").siblings("li").removeClass("active").find("li").removeClass("active"); h.closest("li").siblings("li").find("ul:visible").slideUp(); h.siblings("ul").slideDown()
 +
                    }
 +
                }
 +
            }
 +
 +
        ); var g=a(window); g.on("load", function() {
 +
                AOS.init( {
 +
                        once:true,
 +
                    }
 +
 +
                )
 +
            }
 +
 +
        ); Splitting(); a(".date-pic").datepicker( {
 +
                showOn:"button", buttonText:'<i class="icofont-calendar"></i>'
 +
            }
 +
 +
        ); a(".gallery-filter-nav").on("click", "button", function() {
 +
                var h=a(this).attr("data-filter"); b.isotope( {
 +
                        filter:h
 +
                    }
 +
 +
                ); a(this).siblings(".active").removeClass("active"); a(this).addClass("active")
 +
            }
 +
 +
        ); var b=a(".gallery-filter-wrapper").isotope( {
 +
                itemSelector:".filter-item", percentPosition:true,
 +
            }
 +
 +
        ); a(".popup-gallery").magnificPopup( {
 +
                delegate:"a", type:"image"
 +
            }
 +
 +
        ); a(function() {
 +
                var h=a("#contact-form"); var i=a(".form-messege"); a(h).on("submit", function(j) {
 +
                        j.preventDefault(); var k=a(h).serialize(); a.ajax( {
 +
                                type:"POST", url:a(h).attr("action"), data:k
 +
                            }
 +
 +
                        ).done(function(l) {
 +
                                a(i).removeClass("error"); a(i).addClass("success"); a(i).text(l); a("#contact-form input,#contact-form textarea").val("")
 +
                            }
 +
 +
                        ).fail(function(l) {
 +
                                a(i).removeClass("success"); a(i).addClass("error"); if(l.responseText !=="") {
 +
                                    a(i).text(l.responseText)
 +
                                }
 +
 +
                                else {
 +
                                    a(i).text("Oops! An error occured and your message could not be sent.")
 +
                                }
 +
                            }
 +
 +
                        )
 +
                    }
 +
 +
                )
 +
            }
 +
 +
        ); function f() {
 +
            var i=a("#scroll-top"), h=0, j=a(window); j.on("scroll", function() {
 +
                    var k=a(this).scrollTop(); if(k>h) {
 +
                        i.removeClass("show")
 +
                    }
 +
 +
                    else {
 +
                        if(j.scrollTop()>200) {
 +
                            i.addClass("show")
 +
                        }
 +
 +
                        else {
 +
                            i.removeClass("show")
 +
                        }
 +
                    }
 +
 +
                    h=k
 +
                }
 +
 +
            ); i.on("click", function(k) {
 +
                    a("html, body").animate( {
 +
                            scrollTop:0
 +
                        }
 +
 +
                        , 600); k.preventDefault()
 +
                }
 +
 +
            )
 +
        }
 +
 +
        f()
 +
    }
 +
 +
)(jQuery);

Latest revision as of 13:19, 16 October 2021

(function(a) {

       a(window).on("scroll", function() {
               if(a(this).scrollTop()>0) {
                   a(".sticky-header").addClass("sticky")
               }
               else {
                   a(".sticky-header").removeClass("sticky")
               }
           }
       ); var e=new Swiper(".slider-container.swiper-container", {
               spaceBetween:30, centeredSlides:true, speed:3000, autoplay:false, loop:true, effect:"fade", fadeEffect: {
                   crossFade:true
               }
               , on: {
                   slideChange:function() {
                       var h=this.realIndex+1; document.querySelector(".current-slide").innerHTML=h
                   }
                   , paginationRender:function() {
                       var h=document.getElementsByClassName("swiper-pagination-bullet").length; document.querySelector(".total-slides").innerHTML=h
                   }
               }
           }
       ); var e=new Swiper(".team-carousel .swiper-container", {
               slidesPerView:1, speed:1000, loop:true, spaceBetween:30, autoplay:false, effect:"fade", fadeEffect: {
                   crossFade:true,
               }
               , navigation: {
                   nextEl:".team-carousel .swiper-button-next", prevEl:".team-carousel .swiper-button-prev",
               }
           }
       ); var e=new Swiper(".testimonial-carousel.swiper-container", {
               slidesPerView:1, speed:1000, loop:true, spaceBetween:30, autoplay:true, navigation: {
                   nextEl:".testimonial-carousel .swiper-button-next", prevEl:".testimonial-carousel .swiper-button-prev",
               }
           }
       ); a(".video-popup").magnificPopup( {
               type:"iframe"
           }
       ); a(".header-action-btn-menu").on("click", function() {
               a("body").addClass("fix"); a(".mobile-menu-wrapper").addClass("open")
           }
       ); a(".offcanvas-btn-close,.offcanvas-overlay").on("click", function() {
               a("body").removeClass("fix"); a(".mobile-menu-wrapper").removeClass("open")
           }
       ); var c=a(".mobile-menu, .category-menu"), d=c.find(".dropdown"); d.slideUp(); c.on("click", "li a, li .menu-expand", function(i) {
               var h=a(this); if((h.parent().attr("class").match(/\b(menu-item-has-children|has-children|has-sub-menu)\b/))&&(h.attr("href")==="#"||h.hasClass("menu-expand"))) {
                   i.preventDefault(); if(h.siblings("ul:visible").length) {
                       h.parent("li").removeClass("active"); h.siblings("ul").slideUp()
                   }
                   else {
                       h.parent("li").addClass("active"); h.closest("li").siblings("li").removeClass("active").find("li").removeClass("active"); h.closest("li").siblings("li").find("ul:visible").slideUp(); h.siblings("ul").slideDown()
                   }
               }
           }
       ); var g=a(window); g.on("load", function() {
               AOS.init( {
                       once:true,
                   }
               )
           }
       ); Splitting(); a(".date-pic").datepicker( {
               showOn:"button", buttonText:''
           }
       ); a(".gallery-filter-nav").on("click", "button", function() {
               var h=a(this).attr("data-filter"); b.isotope( {
                       filter:h
                   }
               ); a(this).siblings(".active").removeClass("active"); a(this).addClass("active")
           }
       ); var b=a(".gallery-filter-wrapper").isotope( {
               itemSelector:".filter-item", percentPosition:true,
           }
       ); a(".popup-gallery").magnificPopup( {
               delegate:"a", type:"image"
           }
       ); a(function() {
               var h=a("#contact-form"); var i=a(".form-messege"); a(h).on("submit", function(j) {
                       j.preventDefault(); var k=a(h).serialize(); a.ajax( {
                               type:"POST", url:a(h).attr("action"), data:k
                           }
                       ).done(function(l) {
                               a(i).removeClass("error"); a(i).addClass("success"); a(i).text(l); a("#contact-form input,#contact-form textarea").val("")
                           }
                       ).fail(function(l) {
                               a(i).removeClass("success"); a(i).addClass("error"); if(l.responseText !=="") {
                                   a(i).text(l.responseText)
                               }
                               else {
                                   a(i).text("Oops! An error occured and your message could not be sent.")
                               }
                           }
                       )
                   }
               )
           }
       ); function f() {
           var i=a("#scroll-top"), h=0, j=a(window); j.on("scroll", function() {
                   var k=a(this).scrollTop(); if(k>h) {
                       i.removeClass("show")
                   }
                   else {
                       if(j.scrollTop()>200) {
                           i.addClass("show")
                       }
                       else {
                           i.removeClass("show")
                       }
                   }
                   h=k
               }
           ); i.on("click", function(k) {
                   a("html, body").animate( {
                           scrollTop:0
                       }
                       , 600); k.preventDefault()
               }
           )
       }
       f()
   }

)(jQuery);