PageSourceSearch

http://www.ksdaily.co.kr/script/onScroll.js?ver=11.0.0

js ksdaily.co.kr collected 2026-10-05 02:02:00 UTC 3,768 bytes, 122 lines download raw bytes

1var	top_last_scroll		= 0;
2var	diff_scroll			= 0;
3
4function	onScrollDirection()
5{
6	var	function_direction	= function()
7	{
8		var	top_scroll	= jQuery(document).scrollTop();
9		window.diff_scroll		= top_scroll - window.top_last_scroll;
10		window.top_last_scroll	= top_scroll;
11		
12		jQuery(window).trigger("onScrollAdjustEndLine");
13	};
14	
15	jQuery(window).scroll(function_direction);
16	jQuery(window).resize(function_direction);
17	
18	setTimeout(function(){window.diff_scroll=-1;jQuery(window).trigger("onScrollAdjustEndLine");}, 200);
19};
20
21function	onScrollAdjustEndLine(query_start, query_end, query_in)
22{
23	jQuery(window).on
24	(
25		"onScrollAdjustEndLine",
26		function()
27		{
28			var	obj_start	= jQuery(query_start);
29			var	obj_end		= jQuery(query_end);
30			var	obj_in		= jQuery(query_in);
31			
32			if ( obj_start && obj_end && obj_in )
33			{
34				var	top_in		= obj_in.offset().top;
35				var	top_win		= jQuery(document).scrollTop();
36				var	top_start	= obj_start.offset().top;
37				var	top_end		= obj_end.offset().top;
38				var	left_start	= obj_start.offset().left;
39				var	width_start	= obj_start.width();
40				var	height_win	= jQuery(window).height();
41				var	height_end	= obj_end.height();
42				var	height_in	= obj_in.height();
43				var	bot_win		= top_win + height_win;
44				var	bot_end		= top_end + height_end;
45				var	bot_in		= top_in + height_in;
46				
47				var	gap_max		= top_end + height_end - top_start - height_in;
48				
49				obj_start.css({"height":height_in+"px"});
50				
51				if ( window.diff_scroll == 0 )
52				{
53					if ( obj_in.css("position") == "fixed" )
54					{
55						obj_in.css({"left":left_start+"px"});
56					}
57				}
58				
59				if ( height_in >= bot_end - top_start )
60				{
61					//	움직일 필요가 없음
62					obj_in.css({"position":"relative","top":"0px","left":"0px","width":""});
63				}
64				else if ( height_win > top_end + height_end - top_start )
65				{
66					obj_in.css({"position":"relative","top":"0px","left":"0px","width":""});
67				}					
68				else if ( height_win > height_in )
69				{
70					if ( top_start >= top_win )
71					{
72						obj_in.css({"position":"relative","top":"0px","left":"0px","width":""});
73					}
74					else if ( top_start + gap_max <= top_win )
75					{
76						obj_in.css({"position":"relative","top":gap_max+"px","left":"0px","width":""});
77					}						
78					else
79					{
80						obj_in.css({"position":"fixed","top":"0px","left":left_start+"px","width":width_start+"px"});
81					}
82				}
83				else
84				{
85					if ( window.diff_scroll < 0 )
86					{
87						if ( top_start >= top_win )
88						{
89							obj_in.css({"position":"relative","top":"0px","left":"0px","width":""});
90						}
91						else if ( top_in >= top_win )
92						{
93							obj_in.css({"position":"fixed","top":"0px","left":left_start+"px","width":width_start+"px"});
94						}
95						else if ( obj_in.attr("data-direction") == "down" && obj_in.css("position") == "fixed" )
96						{
97							obj_in.css({"position":"relative","top":(top_in-top_start-diff_scroll)+"px","left":"0px","width":""});
98						}
99						obj_in.attr("data-direction", "up");
100					}
101					
102					if ( window.diff_scroll > 0 )
103					{
104						if ( bot_end <= bot_win )
105						{
106							obj_in.css({"position":"relative","top":gap_max+"px","left":"0px","width":""});
107						}
108						else if ( bot_in <= bot_win )
109						{
110							obj_in.css({"position":"fixed","top":(height_win-height_in)+"px","left":left_start+"px","width":width_start+"px"});
111						}
112						else if ( obj_in.attr("data-direction") == "up" && obj_in.css("position") == "fixed" )
113						{
114							obj_in.css({"position":"relative","top":(top_in-top_start-diff_scroll)+"px","left":"0px","width":""});
115						}
116						obj_in.attr("data-direction", "down");
117					}
118				}
119			}
120		}
121	);
122};

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.