PageSourceSearch

https://www.town.uchiko.ehime.jp/ssi/js/common-top.js

js town.uchiko.ehime.jp collected 2026-10-02 14:40:09 UTC 1,790 bytes, 51 lines download raw bytes

1jQuery(document).ready(function($){
2
3	// バナーランダム表示
4	function banner_random(targetElement){
5		// リストの親要素に、IDと併せてクラス’banner_random’を指定する。
6		// <div id="example" class="banner_random"><ul><li>...</li></ul></div>
7		// banner_random を指定したクラスのIDを取得し、それぞれにランダム表示する。
8		function shuffle(array) {
9			var n = array.length, t, i;
10			while (n) {
11				i = Math.floor(Math.random() * n--);
12				t = array[n];
13				array[n] = array[i];
14				array[i] = t;
15			}
16			return array;
17		}
18		var targetArry = [];
19		// ターゲットのリストタグを配列に取り込む
20		$(targetElement + ' > ul > li').each(function(i){
21			targetArry[i] = $(this).prop('outerHTML');
22		});
23		// 取り込んだ配列をランダムに並び替え
24		shuffle(targetArry);
25		$(targetElement + ' > ul').empty();
26		// ランダムに並び替えられた配列をターゲットのulタグ内に入れ込む
27		for(var j = targetArry.length; j >= 0; j-- ){
28			$(targetElement + ' > ul').append(targetArry[j]);
29		}
30	}
31	$('.banner_random').each(function(){
32		banner_random('#' + $(this).attr('id'));
33	});
34
35	// フッターバナー広告
36	$('#top_banner_kokoku_list').each(function(){
37		var $this = $(this),
38			$bnrList = $this.find('li'),
39			bnrListLength = $bnrList.length,
40			bnrBoshuEl = '<li id="top_banner_kokoku_boshu"><img src="/img/common/banner_boshuchu.jpg" alt="内子町公式ホームページ 広告バナー募集中" /></li>';
41		// 広告募集バナーを挿入
42		$this.prepend(bnrBoshuEl);
43		// 広告バナーの偶数/奇数を判定
44		if(!((bnrListLength % 2) === 0)){
45			$this.addClass('count_is_odd');
46		}
47	});
48
49	$('#spm_search').off();
50
51});

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.