( function($) {
/**
* Mobile menu
*/
$( '.dropdown-toggle' ).on( 'click', function(){
$( this ).toggleClass( 'toggled' );
$( this ).next().slideToggle();
} );
// Function to show the menu
function show_menu() {
$( '.nav-parent' ).addClass( 'mobile-menu-open' );
$( '.mobile-menu-overlay' ).addClass( 'mobile-menu-active' );
}
// Function to hide the menu
function hide_menu(){
$( '.nav-parent' ).removeClass( 'mobile-menu-open' );
$( '.mobile-menu-overlay' ).removeClass( 'mobile-menu-active' );
}
$( '.menubar-right' ).on( 'click', show_menu );
$( '.mobile-menu-overlay' ).on( 'click', hide_menu );
$( '.menubar-close' ).on( 'click', hide_menu );
/**
* 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 );