/home/moonrcjl/template.moontelict.com/a.maxfy-prev/assets/js/main.js

(function ($) {
  "use strict";

  var windowOn = $(window);

  ////////////////////////////////////////////////////
  // 1. preloader Js
  windowOn.on('load', function () {
    $("#loading").fadeOut(500);
  })

  ////////////////////////////////////////////////////
  // 2. Back-to-top Js
  var btn = $("#back-to-top");
  windowOn.scroll(function () {
    if (windowOn.scrollTop() > 300) {
      btn.addClass("show");
    } else {
      btn.removeClass("show");
    }
  });
  btn.on("click", function () {
    $("html, body").animate({ scrollTop: 0 }, "300");
  });

  // data bg img
  $("[data-background]").each(function () {
    $(this).css(
      "background-image",
      "url(" + $(this).attr("data-background") + ")"
    );
  });

  // data bg color
  $("[data-bg-color]").each(function () {
    $(this).css("background-color", $(this).attr("data-bg-color"));
  });


  ////////////////////////////////////////////////////
  // 10. Swiper mt-brand-title-active slider
  var swiper = new Swiper(".mt-brand-title-active", {
    slidesPerView: "auto",
    spaceBetween: 20,
    freemode: true,
    centeredSlides: true,
    loop: true,
    speed: 9000,
    allowTouchMove: false,
    autoplay: {
      delay: 1,
      disableOnInteraction: true,
    },
  });
  ////////////////////////////////////////////////////
  // 10. Swiper mt-brand-title-active slider
  var swiper = new Swiper(".mt-brand-2-active", {
    slidesPerView: "auto",
    spaceBetween: 20,
    freemode: true,
    centeredSlides: true,
    loop: true,
    speed: 9000,
    allowTouchMove: false,
    autoplay: {
      delay: 1,
      disableOnInteraction: true,
    },
  });
  ////////////////////////////////////////////////////
  // 10. Swiper mt-brand-title-active slider
  var swiper = new Swiper(".mt-brand-3-active", {
    slidesPerView: "auto",
    spaceBetween: 20,
    freemode: true,
    centeredSlides: true,
    loop: true,
    speed: 9000,
    allowTouchMove: false,
    autoplay: {
      delay: 1,
      disableOnInteraction: true,
    },
  });
  ////////////////////////////////////////////////////
  // 10. Swiper mt-brand-title-active slider
  var swiper = new Swiper(".mt-brand-4-active", {
    slidesPerView: "auto",
    spaceBetween: 20,
    freemode: true,
    centeredSlides: true,
    loop: true,
    speed: 9000,
    allowTouchMove: false,
    autoplay: {
      delay: 1,
      disableOnInteraction: true,
    },
  });


    // jarallax
  if ($('.jarallax').length) {
    $('.jarallax').jarallax({
      speed: 0.2,
    });
  }



})(jQuery);