(function($) {
"use strict";
$(document).on('ready', function() {
jQuery(window).on('scroll', function() {
if ($(this).scrollTop() > 200) {
$('#header .header-inner').addClass("sticky");
} else {
$('#header .header-inner').removeClass("sticky");
}
});
// Mobile Menu //
$(function(){
$('#nav').slicknav({
'label' : '',
'prependTo': '.mobile-menu',
});
});
$('.home-slider').owlCarousel({
items:1,
autoplay:false,
autoplayTimeout:5000,
smartSpeed: 1000,
autoplayHoverPause:true,
animateIn: 'fadeIn',
animateOut: 'fadeOut',
loop:true,
merge:true,
nav:true,
dots:false,
navText: ['', ''],
});
$('.testimonial-slider').owlCarousel({
autoplay:false,
autoplayTimeout:4500,
smartSpeed:300,
autoplayHoverPause:true,
loop:true,
merge:true,
nav:false,
dots:true,
responsive:{
300: {
items:1,
},
480: {
items:1,
},
768: {
items:2,
},
1170: {
items:2,
}
}
});
$('.clients-slider').owlCarousel({
autoplay:true,
autoplayTimeout:4500,
margin:15,
smartSpeed: 1000,
autoplayHoverPause:true,
loop:true,
nav:false,
dots:false,
responsive:{
300: {
items:2,
},
480: {
items:3,
},
768: {
items:4,
},
1170: {
items:6,
}
}
});
$('.counter').counterUp({
delay: 10,
time: 5000
});
$('#nav').onePageNav({
changeHash: false,
scrollSpeed: 1000,
filter: '',
});
$('.popup').magnificPopup({
type: 'image',
gallery:{
enabled:true
}
});
$('.panel').on('click', function() {
$(".panel").removeClass("active");
$(this).addClass("active");
});
// Video Popup //
$('.video-popup').magnificPopup({
type: 'video',
});
// stellar //
$.stellar({
horizontalOffset: 0,
verticalOffset: 0
});
var wow = new WOW(
{
boxClass: 'wow', // animated element css class (default is wow)
animateClass: 'animated', // animation css class (default is animated)
offset: 0, // distance to the element when triggering the animation (default is 0)
mobile: false, // trigger animations on mobile devices (default is true)
live: true, // act on asynchronously loaded content (default is true)
callback: function(box) {
// the callback is fired every time an animation is started
// the argument that is passed in is the DOM node being animated
},
scrollContainer: null // optional scroll container selector, otherwise use window
}
);
wow.init();
/*====================================
Isotop
======================================*/
$(window).on('load', function() {
if ($.fn.isotope) {
$(".isotop-active").isotope({
filter: '*',
});
$('.works-menu ul li').on('click', function() {
$(".works-menu ul li").removeClass("active");
$(this).addClass("active");
var selector = $(this).attr('data-filter');
$(".isotop-active").isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'easeOutCirc',
queue: false,
}
});
return false;
});
}
});
$(function () {
$.scrollUp({
scrollName: 'scrollUp', // Element ID
topDistance: '300', // Distance from top before showing element (px)
topSpeed: 300, // Speed back to top (ms)
animation: 'fade', // Fade, slide, none
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: [""], // Text for element
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
});
});
// Animate Scroll
$('.scroll').on("click", function (e) {
var anchor = $(this);
$('html, body').stop().animate({
scrollTop: $(anchor.attr('href')).offset().top - 100
}, 1000);
e.preventDefault();
});
});
// Preloader
$(window).on('load', function() {
$('.loader').fadeOut('slow', function(){
$(this).remove();
});
});
})(jQuery);