PageSourceSearch

http://c-union.co.jp/sp-contents/js/common2.js

js c-union.co.jp collected 2026-10-05 04:00:39 UTC 1,203 bytes, 50 lines download raw bytes

1$(function(){
2	
3	var set = 50;//ウインドウ上部からどれぐらいの位置で変化させるか
4	
5	var boxTop = new Array;
6	var current = -1;
7	
8	//各要素の位置
9	$('article').each(function(i) {
10        boxTop[i] = $(this).offset().top;
11    });
12	
13	//最初の要素にclass="on"をつける
14	changeBox(0);
15	
16	//スクロールした時の処理
17	$(window).scroll(function(){
18		scrollPosition = $(window).scrollTop();	
19		for (var i = boxTop.length - 1 ; i >= 0; i--) {
20			if ($(window).scrollTop() > boxTop[i] - set) {
21	            changeBox(i);
22	        	break;
23	        }
24		};
25	});
26	
27	//ナビの処理
28	function changeBox(secNum) {
29		if (secNum != current) {
30
31			current = secNum;
32			secNum2 = secNum + 1;//HTML順序用
33						
34			$('#in_link li').removeClass('on');
35			$('#in_link li:nth-child(' + secNum2 +')').addClass('on');
36			
37			/* 位置によって個別に処理をしたい場合 
38			if (current == 0) {
39				// 現在地がsection1の場合の処理
40			} else if (current == 1) {
41				// 現在地がsection2の場合の処理
42			} else if (current == 2) {
43				// 現在地がsection3の場合の処理
44			}*/
45		}
46	};
47
48
49 
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.