/* * Blog64 Theme Custom Scripts * * Copyright (c) 2015 Suman Shrestha * http://www.sumanshresthaa.com.np/ * * Licensed under MIT * */ $('[data-spy="scroll"]').each(function () { var $spy = $(this).scrollspy('refresh') }) // 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; } } }); }); // 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; }); // Animations new WOW().init();