slide_67a40c7.js
898 Bytes
define("modules/js/slide",function(n){var t=n("modules/lib/jquery"),i={paddingTop:t("#nav").height()+1,rang:["home","about","course","contact"],highLight:function(){for(var n=t(document).scrollTop()+this.paddingTop+1,i=this.rang.length-1,o=i;o>=0;o--){var a=t("#"+this.rang[o]+"-section").offset().top;if(n>a){t("#nav").find("a").removeClass("current"),t(".nav-"+this.rang[o]).addClass("current");break}}var r=t(document).scrollTop()>200?.8:0;t("#nav").find(".nav-bg").stop().animate({opacity:r},{duration:100})},scroll:function(n){t(document.body).animate({scrollTop:n},{duration:500})},bindEvents:function(){t("#nav").on("click","a",function(n){var o=t(this).attr("href");o&&"#"===o.charAt(0)&&i.scroll(t(o).offset().top-i.paddingTop),n.preventDefault()});var n=this;t(window).on("scroll",function(){n.highLight()})},init:function(){this.highLight(),this.bindEvents()}};t(function(){i.init()})});