<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">(function($){
	$.fn.tmStickUp = function(options){ 
		
		var getOptions = {
			correctionSelector: $('.correctionSelector')
		}
		$.extend(getOptions, options); 

		var
			_this = $(this),
			_window = $(window),
			_document = $(document),
			thisOffsetTop = 0,
			thisOuterHeight = 0,
			thisMarginTop = 0,
			thisPaddingTop = 0,
			documentScroll = 0,
			pseudoBlock,
			lastScrollValue = 0,
			scrollDir = '',
			tmpScrolled;

		init();
		function init(){
			thisOffsetTop = parseInt(_this.offset().top);
			thisMarginTop = parseInt(_this.css("margin-top"));
			thisOuterHeight = parseInt(_this.outerHeight(true));

			$('&lt;div class="pseudoStickyBlock"&gt;&lt;/div&gt;').insertAfter(_this);
			pseudoBlock = $('.pseudoStickyBlock');
			pseudoBlock.css({"position": "relative", "display": "block"});
			addEventsFunction();
		}//end init

		function addEventsFunction(){
			_document.on('scroll', function() {
				tmpScrolled = $(this).scrollTop();
					if (tmpScrolled &gt; lastScrollValue) {
						scrollDir = 'down';
					} else {
						scrollDir = 'up';
					}
				lastScrollValue = tmpScrolled;

				correctionValue = getOptions.correctionSelector.outerHeight(true);
				documentScroll = parseInt(_window.scrollTop());

				if (thisOffsetTop - correctionValue &lt; documentScroll) {
					_this.addClass('isStuck');
					_this.css({position: "fixed", top: correctionValue});
					pseudoBlock.css({"height": thisOuterHeight});
				} else {
					_this.removeClass('isStuck');
					_this.css({position: "relative", top: 0});
					pseudoBlock.css({"height": 0});
				}
			}).trigger('scroll');
		}
	}//end tmStickUp function
})(jQuery)</pre></body></html>