forked from lucia116/nitro888.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nitro888.min.js
1 lines (1 loc) · 1.27 KB
/
nitro888.min.js
1
(function($){"use strict";$('a.js-scroll-trigger[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-70)},1000,"easeInOutExpo");return!1}}});$(document).scroll(function(){var scrollDistance=$(this).scrollTop();if(scrollDistance>100){$('.scroll-to-top').fadeIn()}else{$('.scroll-to-top').fadeOut()}});$('.js-scroll-trigger').click(function(){$('.navbar-collapse').collapse('hide')});$('body').scrollspy({target:'#mainNav',offset:80});var navbarCollapse=function(){if($("#mainNav").offset().top>100){$("#mainNav").addClass("navbar-shrink")}else{$("#mainNav").removeClass("navbar-shrink")}};navbarCollapse();$(window).scroll(navbarCollapse);$(function(){$("body").on("input propertychange",".floating-label-form-group",function(e){$(this).toggleClass("floating-label-form-group-with-value",!!$(e.target).val())}).on("focus",".floating-label-form-group",function(){$(this).addClass("floating-label-form-group-with-focus")}).on("blur",".floating-label-form-group",function(){$(this).removeClass("floating-label-form-group-with-focus")})})})(jQuery)