1function ScrollingSpy(settings) { 2 this.options = settings; 3 4 var $this = this, 5 navbar = $(this.options.navbar); 6 7 this.navbarSticky = function(scrollTop) { 8 if (scrollTop >= this.options.offset) { 9 navbar.addClass("navbar-sticky") 10 } else { 11 navbar.removeClass("navbar-sticky") 12 } 13 }; 14 15 this.pricingSticky = function(scrollTop, pricingPlansTop) { 16 if (scrollTop >= pricingPlansTop && scrollTop < (pricingPlansTop + $($this.options.pricingStickyElement).height())) { 17 setTimeout(function() { 18 $($this.options.pricingBasis).addClass('keep-sticky'); 19 }, 500); 20 } else { 21 setTimeout(function() { 22 $($this.options.pricingBasis).removeClass('keep-sticky'); 23 }, 500); 24 } 25 }; 26 27 this.initialize = function() { 28 var w = $(window); 29 30 w.on("scroll", function() { 31 var scrollTop = w.scrollTop(); 32 33 $this.navbarSticky(scrollTop); 34 35 if (w.width() <= 768) { 36 var pricingPlansTop = $($this.options.pricingBasis).length ? $($this.options.pricingStickyElement).offset().top - $this.options.offset : null; 37 if (pricingPlansTop) { 38 $this.pricingSticky(scrollTop, pricingPlansTop); 39 } 40 } 41 }); 42 43 this.navbarSticky(w.scrollTop()); 44 if (w.width() <= 768) { 45 this.pricingSticky(w.scrollTop()); 46 } 47 } 48}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.