/*----------------------------------------------------------------------------------- /* /* Init JS /* -----------------------------------------------------------------------------------*/ jQuery(document).ready(function () { $WIN = $(window); /* Preloader * -------------------------------------------------- */ var Preloader = function () { $WIN.on('load', function () { // will first fade out the loading animation $("#loader").fadeOut("slow", function () { // will fade out the whole DIV that covers the website. $("#preloader").delay(300).fadeOut("slow"); }); }); }; /*----------------------------------------------------*/ /* Adjust Primary Navigation Background Opacity ------------------------------------------------------*/ $(window).on('scroll', function () { var h = $('header').height(); var y = $(window).scrollTop(); var header = $('#main-header'); if ((y > h + 200) && ($(window).outerWidth() > 1020)) { header.addClass('opaque'); } else { if (y < h + 200) { header.removeClass('opaque'); } else { header.addClass('opaque'); } } }); /*----------------------------------------------------*/ /* slider /*----------------------------------------------------*/ $(".id-Slider").slick({ dots: true, infinite: true, slidesToShow: 2, slidesToScroll: 1, autoplay: false, arrows: true, prevArrow: '', nextArrow: '', responsive: [{ breakpoint: 811, settings: { arrows: true, centerMode: true, centerPadding: '0px', slidesToShow: 1 } }, { breakpoint: 640, settings: { arrows: false, centerMode: true, centerPadding: '0px', slidesToShow: 1 } } ] }); $(".cert").slick({ dots: true, infinite: true, slidesToShow: 6, slidesToScroll: 3, autoplay: true, arrows: true, prevArrow: '', nextArrow: '', responsive: [{ breakpoint: 811, settings: { arrows: true, centerMode: true, centerPadding: '0px', slidesToShow: 3, slidesToScroll: 3 } }, { breakpoint: 640, settings: { arrows: false, centerMode: true, centerPadding: '0px', slidesToShow: 1 } } ] }); /* Smooth Scrolling * ------------------------------------------------------ */ $('.smoothscroll').on('click', function (e) { e.preventDefault(); var target = this.hash, $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 800, 'swing', function () { window.location.hash = target; }); }); /* Back to Top * ------------------------------------------------------ */ // declare variable var scrollTop = $(".scrollTop"); $(window).scroll(function () { // declare variable var topPos = $(this).scrollTop(); // if user scrolls down - show scroll to top button if (topPos > 100) { $(scrollTop).css("opacity", "1"); } else { $(scrollTop).css("opacity", "0"); } }); // scroll END //Click event to scroll to top $(scrollTop).click(function () { $('html, body').animate({ scrollTop: 0 }, 300); return false; }); // click() scroll top EMD /* Initialize * ------------------------------------------------------ */ (function ssInit() {})(); }); (jQuery);