PageSourceSearch

https://news.guideme.jp/js/jquery-contained-sticky-scroll.js

js guideme.jp collected 2026-10-02 10:49:58 UTC 1,875 bytes, 47 lines download raw bytes

1(function( $ ){
2
3  $.fn.containedStickyScroll = function( options ) {
4  
5	var defaults = {  
6		oSelector : this.selector,
7		unstick : true,
8		easing: 'linear',
9		duration: 500,
10		queue: false,
11		closeChar: '^',
12		closeTop: 0,
13		closeRight: 0  
14	}  
15                  
16	var options =  $.extend(defaults, options);
17  
18	if(options.unstick == true){  
19		this.css('position','relative');
20		this.append('<a class="scrollFixIt">' + options.closeChar + '</a>');
21		jQuery(options.oSelector + ' .scrollFixIt').css('position','absolute');
22		jQuery(options.oSelector + ' .scrollFixIt').css('top',options.closeTop + 'px');
23		jQuery(options.oSelector + ' .scrollFixIt').css('right',options.closeTop + 'px');
24		jQuery(options.oSelector + ' .scrollFixIt').css('cursor','pointer');
25		jQuery(options.oSelector + ' .scrollFixIt').click(function() {
26			getObject = options.oSelector;
27			jQuery(getObject).animate({ top: "0px" },
28				{ queue: options.queue, easing: options.easing, duration: options.duration });
29			jQuery(window).unbind();
30			jQuery('.scrollFixIt').remove();
31		});
32	} 
33  	jQuery(window).scroll(function() {
34  		getObject = options.oSelector;
35        if(jQuery(window).scrollTop() > (jQuery(getObject).parent().offset().top) &&
36           (jQuery(getObject).parent().height() + jQuery(getObject).parent().position().top - 30) > (jQuery(window).scrollTop() + jQuery(getObject).height())){
37        	jQuery(getObject).animate({ top: (jQuery(window).scrollTop() - jQuery(getObject).parent().offset().top) + "px" }, 
38            { queue: options.queue, easing: options.easing, duration: options.duration });
39        }
40        else if(jQuery(window).scrollTop() < (jQuery(getObject).parent().offset().top)){
41        	jQuery(getObject).animate({ top: "0px" },
42            { queue: options.queue, easing: options.easing, duration: options.duration });
43        }
44	});
45
46  };
47})( 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.