// Custom Script // Developed by: Samson.Onna // CopyRights : http://webthemez.com var customScripts = { profile: function () { var portfolio = $('#portfolio'); var items = $('.items', portfolio); var filters = $('.filters li a', portfolio); items.imagesLoaded(function() { items.isotope({ itemSelector: '.item', layoutMode: 'fitRows', transitionDuration: '0.7s' }); }); filters.click(function(){ var el = $(this); filters.removeClass('active'); el.addClass('active'); var selector = el.attr('data-filter'); items.isotope({ filter: selector }); return false; }); }, fancybox: function () { // fancybox $(".fancybox").fancybox(); }, onePageNav: function () { $('#mainNav').onePageNav({ currentClass: 'active', changeHash: false, scrollSpeed: 950, scrollThreshold: 0.2, filter: '', easing: 'swing', begin: function () { //I get fired when the animation is starting }, end: function () { //I get fired when the animation is ending if(!$('#main-nav ul li:first-child').hasClass('active')){ $('.header').addClass('addBg'); }else{ $('.header').removeClass('addBg'); } }, scrollChange: function ($currentListItem) { //I get fired when you enter a section and I pass the list item of the section if(!$('#main-nav ul li:first-child').hasClass('active')){ $('.header').addClass('addBg'); }else{ $('.header').removeClass('addBg'); } } }); $("a[href='#top']").click(function () { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); $("a[href='#basics']").click(function () { $("html, body").animate({ scrollTop: $('#services').offset().top}, "slow"); return false; }); }, owlSlider: function () { var owl = $("#owl-demo"); owl.owlCarousel(); // Custom Navigation Events $(".next").click(function () { owl.trigger('owl.next'); }) $(".prev").click(function () { owl.trigger('owl.prev'); }) }, bannerHeight: function () { var bHeight = $(".banner-container").height(); $('#da-slider').height(bHeight); $(window).resize(function () { var bHeight = $(".banner-container").height(); $('#da-slider').height(bHeight); }); }, waySlide: function(){ /* Waypoints Animations ------------------------------------------------------ */ $('#services').waypoint(function() { $('#services .col-md-3').addClass( 'animated fadeInUp show' ); }, { offset: 600}); $('#features').waypoint(function() { $('#features').addClass( 'animated fadeInUp show' ); }, { offset: 400}); $('#aboutUs').waypoint(function() { $('#aboutUs').addClass( 'animated fadeInUp show' ); }, { offset: 400}); $('#clients').waypoint(function() { $('#clients').addClass( 'animated fadeInUp show' ); }, { offset: 400}); $('#contactUs').waypoint(function() { $('#contactUs .parlex-back').addClass( 'animated fadeInUp show' ); }, { offset: 400}); $('#plans').waypoint(function() { $('#plans').addClass( 'animated fadeInUp show' ); }, { offset: 400}); $('#portfolio').waypoint(function() { $('#portfolio').addClass( 'animated fadeInLeft show' ); }, { offset: 400}); }, fitText: function(){ setTimeout(function() { $('h1.responsive-headline').fitText(1.2, { minFontSize: '18px', maxFontSize: '34px' }); }, 100); }, init: function () { customScripts.onePageNav(); customScripts.profile(); customScripts.fancybox(); customScripts.owlSlider(); customScripts.waySlide(); customScripts.fitText(); customScripts.bannerHeight(); } } $('document').ready(function () { customScripts.init(); $('#services .col-md-3, #features, #aboutUs, #clients, #portfolio, #plans, #contactUs .parlex-back').css('opacity','0'); $( "#menuToggle" ).toggle(function() { $(this).find('i').removeClass('fa-bars').addClass('fa-remove'); $('#mainNav').animate({"right":"0px"}, "slow"); }, function() { $('#mainNav').animate({"right":"-200px"}, "slow"); $(this).find('i').removeClass('fa-remove').addClass('fa-bars'); }); });