/**
 * Theme Js file.
 **/

// Preloader
jQuery(document).ready(function($){
  setTimeout(function () {
    $(".loader").fadeOut("slow");
  }, 1000);
});

// Scroll to top
jQuery(function($){
  $(window).scroll(function() {
    if ($(this).scrollTop() >= 50) {
      $('#return-to-top').fadeIn(200);
    } else {
      $('#return-to-top').fadeOut(200);
    }
  });
  $('#return-to-top').click(function() {
    $('body,html').animate({
      scrollTop: 0
    }, 500);
  });
});

// ===== Mobile responsive Menu ====
function babysitter_childcare_menu_open_nav() {
  jQuery(".sidenav").addClass('open');
}
function babysitter_childcare_menu_close_nav() {
  jQuery(".sidenav").removeClass('open');
}

// About
jQuery(document).ready(function($) {
  // Initialize the .abt-cat slider
  $('.abt-cat .owl-carousel').owlCarousel({
    loop: true,
    margin: 0,
    nav: false,
    dots: false,
    rtl: false,
    items: 3,
    autoplay: true,
    autoplayTimeout: 3000,
    autoplayHoverPause: true
  });
});
