$('[data-spy="scroll"]').each(function () { var $spy = $(this).scrollspy('refresh') }) //Tab $(document).ready(function() { var numTabs = $('.nav-tabs').find('li').length; var tabWidth = 100 / numTabs; var tabPercent = tabWidth + "%"; $('.nav-tabs li').width(tabPercent); }); // Smooth scroll $(function() { $('#navbar-html-example a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); // Dropdown Search // Footer testimonials $(document).ready(function() { $("#footer-testimonials").owlCarousel({ navigation : false, // Show next and prev buttons slideSpeed : 300, paginationSpeed : 400, singleItem:true // "singleItem:true" is a shortcut for: // items : 1, // itemsDesktop : false, // itemsDesktopSmall : false, // itemsTablet: false, // itemsMobile : false }); }); // Remove Placeholder $('input,textarea').focus(function(){ $(this).data('placeholder',$(this).attr('placeholder')) $(this).attr('placeholder',''); }); $('input,textarea').blur(function(){ $(this).attr('placeholder',$(this).data('placeholder')); }); //Tab to top $(window).scroll(function() { if ($(this).scrollTop() > 1){ $('.scroll-top-wrapper').addClass("show"); } else{ $('.scroll-top-wrapper').removeClass("show"); } }); $(".scroll-top-wrapper").on("click", function() { $("html, body").animate({ scrollTop: 0 }, 600); return false; }); //Sticky Header $(window).scroll(function() { if ($(this).scrollTop() > 1){ $('.logo-nav-sec').addClass("organictop"); } else{ $('.logo-nav-sec').removeClass("organictop"); } }); //Sticky menu elements page $(window).scroll(function() { if ($(this).scrollTop() > 1){ $('#navbar-html-example').addClass("sticky-menu"); } else{ $('#navbar-html-example').removeClass("sticky-menu"); } }); //Favicon (function() { var link = document.createElement('link'); link.type = 'image/x-icon'; link.rel = 'shortcut icon'; link.href = 'img/icon.png'; document.getElementsByTagName('head')[0].appendChild(link); }()); // Animations new WOW().init();