1(function($) { 2 $.fn.spsticky = function(options) { 3 this.each( function() { 4 var $this = $(this); 5 $this.data('offset-top',$this.data('offset-top')||$this.offset().top); 6 $this.data('max-height',$this.outerHeight()); 7 var $wrapper = $('<div>').addClass('sticky-wrapper').height($this.outerHeight()); 8 $this.wrap($wrapper); 9 var $stickywrapper = $this.parents('.sticky-wrapper'); 10 setInterval(function(){ 11 $stickywrapper.height($this.outerHeight()); 12 },10); 13 $(window).scroll(function(){ 14 if($(window).width() < 992 || $('body').hasClass('header-overlay')) return; 15 var offsetTop = $(window).scrollTop(); 16 if (offsetTop > $this.data('offset-top')){ 17 $this.addClass('fixed'); 18 setTimeout(function(){$this.addClass('fixed-transition')},10); 19 }else{ 20 $this.removeClass('fixed'); 21 setTimeout(function(){$this.removeClass('fixed-transition')},10); 22 } 23 }).resize(function(){ 24 $this.removeClass('fixed fixed-transition').data('offset-top',$this.offset().top); 25 $(window).scroll(); 26 if($(window).width() < 992 || $('body').hasClass('header-overlay')){ 27 $this.removeClass('fixed fixed-transition'); 28 } 29 }).scroll().resize(); 30 }); 31 } 32 $(document).ready(function(){ 33 $('.superhero-sticky').spsticky(); 34 }); 35}(jQuery));
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.