$(document).ready(function () {
/***************** Navbar-Collapse ******************/
$(window).scroll(function () {
if ($(".navbar").offset().top > 50) {
$(".navbar-fixed-top").addClass("top-nav-collapse");
} else {
$(".navbar-fixed-top").removeClass("top-nav-collapse");
}
});
/***************** Page Scroll ******************/
$(function () {
$('a.page-scroll').bind('click', function (event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
/***************** Scroll Spy ******************/
$('body').scrollspy({
target: '.navbar-fixed-top',
offset: 51
})
/***************** Full Width Slide ******************/
var slideHeight = $(window).height();
$('#owl-home .item').css('height', slideHeight);
$(window).resize(function () {
$('#owl-home .item').css('height', slideHeight);
});
/***************** Owl Carousel ******************/
$("#owl-home").owlCarousel({
navigation: true, // Show next and prev buttons
slideSpeed: 3800,
paginationSpeed: 3800,
singleItem: true,
transitionStyle: "fadeUp",
autoPlay: 10000,
navigationText: ["", ""]
});
/***************** portfolio filter ******************/
$(window).load(function () {
'use strict';
var $portfolio_selectors = $('.portfolio-filter >li>a');
var $portfolio = $('.portfolio-items');
$portfolio.isotope({
itemSelector: '.portfolio-item',
layoutMode: 'fitRows'
});
$portfolio_selectors.on('click', function () {
$portfolio_selectors.removeClass('active');
$(this).addClass('active');
var selector = $(this).attr('data-filter');
$portfolio.isotope({
filter: selector
});
return false;
});
});
/***************** Countdown ******************/
$('#fun-facts').bind('inview', function (event, visible, visiblePartX, visiblePartY) {
if (visible) {
$(this).find('.timer').each(function () {
var $this = $(this);
$({
Counter: 0
}).animate({
Counter: $this.text()
}, {
duration: 2000,
easing: 'swing',
step: function () {
$this.text(Math.ceil(this.Counter));
}
});
});
$(this).unbind('inview');
}
});
/***************** Wow.js ******************/
new WOW().init();
/***************** Preloader ******************/
var preloader = $('.preloader');
$(window).load(function () {
preloader.remove();
});
});