Thanks,
//scroll nav colors
$(window).on(‘scroll’, function () {
if ($(this).scrollTop() > 70) {
$(’.header_part’).addClass(“shrink”);
}
else {
$(’.header_part’).removeClass(“shrink”);
}
});
//smoothscroll
$(document).on(‘ready page:load’, function () {
$(document).on(“scroll”, onScroll);
$(‘a[href^="#"]’).on(‘click’, function (e) {
e.preventDefault();
$(document).off(“scroll”);
$('a').each(function () {
$(this).removeClass('active');
})
$(this).addClass('active');
var target = this.hash,
menu = target;
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top+2
}, 500, 'swing', function () {
$(document).on("scroll", onScroll);
});
});
});
function onScroll(event){
var scrollPos = $(document).scrollTop();
$(’.main_menu a’).each(function () {
var currLink = $(this);
var refElement = $(currLink.attr(“href”));
if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
$(’.main_menu ul li a’).removeClass(“active”);
currLink.addClass(“active”);
}
else{
currLink.removeClass(“active”);
}
});
}
// Mobile Menu
$(document).on(‘ready page:load’, function () {
$menuLeft = $(’.pushmenu-left’);
$nav_list = $(’#nav_list’);
$menuBotton = $(’.pushmenu a’);
$nav_list.on('click', function() {
$(this).toggleClass('active');
$('.pushmenu-push').toggleClass('pushmenu-push-toright');
$menuLeft.toggleClass('pushmenu-open');
});
$menuBotton.on('click', function() {
$('.pushmenu-push').removeClass('pushmenu-push-toright');
$menuLeft.removeClass('pushmenu-open');
});
});
// Slider
var swiper = new Swiper(’.swiper-container’, {
pagination: ‘.swiper-pagination’,
paginationClickable: true,
nextButton: ‘.swiper-button-next’,
prevButton: ‘.swiper-button-prev’,
spaceBetween: 30,
speed: 1600,
loop: true,
parallax: true,
effect: ‘fade’,
autoplay: 5000
});
//Team Slider
$(document).on(‘ready page:load’, function () {
var owl = $(’.team_slider .owl-carousel’);
owl.owlCarousel({
loop: true,
nav: true,
dots: false,
margin: 10,
autoplay:true,
autoplayTimeout:3000,
autoplayHoverPause:true,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
960: {
items: 3
},
1200: {
items: 3
}
}
});
$(’.team_slider .owl-carousel’).on(‘mousewheel’, ‘.owl-stage’, function(e) {
if (e.deltaY > 0) {
owl.trigger(‘next.owl’);
} else {
owl.trigger(‘prev.owl’);
}
e.preventDefault();
});
})
// Count Up
var a = 0;
$(window).on(‘scroll’, function() {
var oTop = $(’#counter’).offset().top - window.innerHeight;
if (a === 0 && $(window).scrollTop() > oTop) {
$(’.counter-value’).each(function() {
var $this = $(this),
countTo = $this.attr(‘data-count’);
$({
countNum: $this.text()
}).animate({
countNum: countTo
},
{
duration: 2000,
easing: ‘swing’,
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
//alert(‘finished’);
}
});
});
a = 1;
}
});
// Portfolio Gallery
$(function() {
var selectedClass = “”;
$(".fil-btn").on(‘click’, function() {
selectedClass = $(this).attr(“data-rel”);
var works = $("#works");
works.fadeTo(100, 0.1);
var tile = $("#works .tile");
tile.not("."+selectedClass).fadeOut().removeClass(‘scale-anm’);
setTimeout(function() {
$("."+selectedClass).fadeIn().addClass(‘scale-anm’);
works.fadeTo(300, 1);
}, 300);
});
});
$(’.filter_menu’).on(‘click’, ‘a’, function (e) {
e.preventDefault();
$(this).parent().addClass(‘active’).siblings().removeClass(‘active’);
var filterValue = $(this).attr(‘data-rel’);
});
// Magnific Popup
$(’.gallery’).each(function() { // the containers for all your galleries
$(this).magnificPopup({
delegate: ‘a’, // the selector for gallery item
type: ‘image’,
gallery: {
enabled:true
}
});
});
// Testimonials Slider
$(document).on(‘ready page:load’, function () {
$(’.testi_slider .owl-carousel’).owlCarousel({
items: 1,
margin: 10,
loop: true,
nav: false,
autoHeight: true,
autoplay:true,
autoplayTimeout:5000,
autoplayHoverPause:true
});
})
// Progress Bar
$(window).on(‘scroll’, function() {
$(".progress-bar").each(function(){
each_bar_width = $(this).attr(‘aria-valuenow’);
$(this).width(each_bar_width + ‘%’);
});
// }
});
// Preloader
$(window).on(‘load’, function() {
$(".loader").fadeOut(“slow”);
})