PageSourceSearch

https://idreamsky.com/tpl/www/js/pointScroll.js

js idreamsky.com collected 2026-10-03 17:33:47 UTC 1,138 bytes, 50 lines download raw bytes

1(function() {
2	function hScroll(options) {
3		var self = this;
4		self = Object.assign(self, {
5			nav1: '',
6			nav2: '',
7			check: '',
8			outHeight: ''
9		}, options);
10		self.init();
11	}
12
13	hScroll.prototype = {
14		init: function() {
15			var self = this,
16				arr = [],
17				kdiv = $(self.nav2);
18			for(var i = 0; i < kdiv.length; i++) {
19				arr.push($(kdiv[i]).offset().top);
20			}
21			self.sctopFun(arr);
22			$(window).scroll(function(e) {
23				self.sctopFun(arr);
24			});
25			$(self.nav1).click(function(e) {
26				$('body,html').animate({
27					scrollTop: arr[$(this).index()] - self.outHeight + 'px'
28				},1000);
29			});
30		},
31		sctopFun: function(arr) {
32			var self = this;
33			var scrollTop = document.body.scrollTop || document.documentElement.scrollTop || window.pageYOffset;
34			var keys = 0,
35				flag = true;
36			for(var i = 0; i < arr.length; i++) {
37				keys++;
38				if(flag) {
39					if(scrollTop >= arr[arr.length - keys] - 300) {
40						$(self.nav1).eq(arr.length - keys).addClass(self.checkClass).siblings().removeClass(self.checkClass);
41						flag = false;
42					} else {
43						flag = true;
44					}
45				}
46			}
47		},
48	}
49	window.hScroll = hScroll;
50}());

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.