starter-template
Version:
starter Is The Beautiful One Page starter Template for Bootstrap 4.
1 lines • 685 B
JavaScript
function scrollToDiv(){$('a[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=$(this.hash);if((e=e.length?e:$("[name="+this.hash.slice(1)+"]")).length)return $("html,body").animate({scrollTop:e.offset().top},1e3),!1}})}$(window).on("load",function(){$(".loader").delay(1e3).fadeOut("slow")}),$(document).ready(function(){$("#currentYear").text((new Date).getFullYear());var e=$(window).innerHeight();768<=$(window).innerWidth()&&$("#cover").css("height",e),scrollToDiv(),$(window).scroll(function(){100<$(this).scrollTop()?$(".scrollUp").fadeIn():$(".scrollUp").fadeOut()})});