You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
866 B
1 lines
866 B
!function(t){"use strict";let e,l,i,s,n={activeClass:"active",fixed:!0},o=[],r=function(){let n=o.length>0?o[0].element.offset().top+e.scrollTop():0;t.each(o,function(){let t=Math.floor(this.element.offset().top+e.scrollTop()-n),o=Math.ceil(e.scrollTop());if(t<=o&&o<t+Math.floor(this.element.outerHeight()))return this.link.hasClass(i)||(l.removeClass(i),this.link.addClass(i)),!1;s&&this.link.removeClass("active")})};t.fn.scrollSpy=function(h){if("object"==typeof h&&void 0!==h.target)return function(h){let c=t.extend({},n,h);e=this,l=c.target,i=c.activeClass,s=c.fixed;let u=null,a=null;return t.each(l,function(){void 0!==(u=this.href.split("#")[1])&&(a=e.find(`[id="${u}"]`)).length>0&&o.push({link:t(this),element:a})}),this.unbind("scroll",r).bind("scroll",r),this}.apply(this,arguments);t.error("You should use plugin with required options...")}}(jQuery);
|
|
|