(function($) {
/**
* Mobile menu
*/
$("#nav-toggle").on("focus", function() {
$("#nav-toggle").trigger("click");
});
// Add class in navigation alt search form
$(".search-form .search-icon").click(function() {
$(".search-form").toggleClass("search-form-show");
});
$(".search-form .close-icon").click(function() {
$(".search-form").removeClass("search-form-show");
});
// Menu bar show and hide in focus attributes
$("#navbarmenus .menu-item:last-child").focusout(function() {
$("#navbarmenus, .menu-overlay-bg").removeClass("show");
});
$(".menu-item-has-children").focus(function() {
alert("Handler for .focus() called.");
});
/**
* Slick Slider
*/
$(".ct-slick").slick({
nextArrow: '',
prevArrow: ''
});
$(".ct-testimonial-slider").slick();
/**
* Flipbox responsive
*/
$(".flip-front").each(function() {
$height = $(this).height();
$(this)
.parent()
.parent()
.css("min-height", $height + "px");
});
$(window).on("resize", function() {
$(".flip-front").each(function() {
$height = $(this).height();
$(this)
.parent()
.parent()
.css("min-height", $height + "px");
});
});
/**
* Back to Top
*/
$("#back-to-top").on("click", function(e) {
e.preventDefault();
$("html, body").animate({ scrollTop: 0 }, 1000);
});
$(window).scroll(function() {
if ($(this).scrollTop() > 800) {
$("#back-to-top").fadeIn();
} else {
$("#back-to-top").fadeOut();
}
});
})(jQuery);