(function($) {
    "use strict";
    jQuery(document).ready(function($) {

        /**-----------------------------------
         * back to top
        ------------------------------------*/
        $(document).on('click', '.back-to-top', function() {
            $("html,body").animate({
                scrollTop: 0
            }, 2000);
        });
        /*------------------------------
            $('#menu').slicknav();
        ---------------------------------*/
        $('#primary-menu').slicknav({
            prependTo: '#responsive-mobile-menu',
            label: ''
        });
    });
    //
    $('.blog-post-thumbnail-carousel').owlCarousel({
        loop: true,
        autoplay: true, //true if you want enable autoplay
        autoPlayTimeout: 1000,
        margin: 30,
        dots: true,
        nav: false,
        // animateOut: 'fadeOut',
        // animateIn: 'fadeIn',
        responsive: {
            0: {
                items: 1,
                nav: false
            },
            768: {
                items: 1,
                nav:false
            },
            960: {
                items: 1
            },
            1200: {
                items: 1
            },
            1920: {
                items: 1
            }
        }
    });

    $(window).on('scroll', function() {
        /*---------------------------
            back to top show / hide
        ----------------------------*/
        var ScrollTop = $('.back-to-top');
        if ($(window).scrollTop() > 1000) {
            ScrollTop.fadeIn(1000);
        } else {
            ScrollTop.fadeOut(1000);
        }
    });

    $(window).on('load', function() {
        var backtoTop = $('.back-to-top')
        backtoTop.fadeOut(100);
    });

}(jQuery));