PageSourceSearch

https://www.worldlibrary.co.jp/js/functions.js

js worldlibrary.co.jp collected 2026-10-04 13:25:32 UTC 8,943 bytes, 292 lines download raw bytes

1/* *********************************************** */
2// Rollover Image
3/* *********************************************** */
4$(function(){
5	var preLoadImg = new Object();
6	$("input.imgover,img.imgover").each(function(){
7		var imgSrc = this.src;
8		var sep = imgSrc.lastIndexOf('.');
9		var onSrc = imgSrc.substr(0, sep) + '_o' + imgSrc.substr(sep, 4);
10		preLoadImg[imgSrc] = new Image();
11		preLoadImg[imgSrc].src = onSrc;
12		$(this).hover(
13			function() { this.src = onSrc; },
14			function() { this.src = imgSrc; }
15		);
16	});
17	$("img.hover, input.hover").hover(function() {
18		$(this).stop(false, true).animate({opacity: 0.6});
19		},function(){
20			$(this).stop(false, true).animate({opacity: 1});
21	});
22});
23
24/* *********************************************** */
25// Page Top Scroll
26/* *********************************************** */
27$(function(){
28	$('a[href^=#]').click(function(){
29		var speed = 500;
30		var href= $(this).attr("href");
31		var target = $(href == "#" || href == "" ? 'html' : href);
32		var position = target.offset().top;
33		$("html, body").animate({scrollTop:position}, speed, "swing");
34		return false;
35	});
36});
37/* *********************************************** */
38// TOP Info
39/* *********************************************** */
40$(document).ready(function(){
41	$('#infoSec ul#infoListMore').hide();
42	$('#infoMore p.active').hide();
43	$('#infoMore').click(function(){
44		$('#infoSec ul#infoListMore').slideToggle(600);
45		if ($('#infoMore .inactive').is(':visible')) {
46			$('#infoMore p.inactive').hide();$('#infoMore p.active').show();
47		} else {
48			$('#infoMore p.inactive').show();$('#infoMore p.active').hide();
49		}
50	});
51	/*$("header nav#headNavi .open_tab").click(function () {
52		$("header nav#headNavi .nav").toggleClass("active");
53		$("header .menu-trigger").toggleClass('active');
54	});
55	$("header #naviCol li").click(function () {
56		$("header nav#headNavi .nav").toggleClass("active");
57		$("header .menu-trigger").toggleClass('active');
58	});*/
59});
60
61var ua = navigator.userAgent.toLowerCase();
62var isMobile = /iphone/.test(ua)||/android(.+)?mobile/.test(ua);
63
64if (!isMobile) {
65    $('a[href^="tel:"]').on('click', function(e) {
66        e.preventDefault();
67    });
68}
69
70/* *********************************************** */
71// Footer Position
72/* *********************************************** */
73/*--------------------------------*
74 *  footerFixed.js
75 *  MIT-style license. 
76 *  2007 Kazuma Nishihata [to-R]
77 *  http://blog.webcreativepark.net
78/*--------------------------------*/
79
80new function(){
81	
82	var footerId = "footer";
83	//ƒƒCƒ“
84	function footerFixed(){
85		//ƒhƒLƒ…ƒƒ“ƒg‚̍‚‚³
86		var dh = document.getElementsByTagName("body")[0].clientHeight;
87		//ƒtƒbƒ^[‚Ìtop‚©‚ç‚̈ʒu
88		document.getElementById(footerId).style.top = "0px";
89		var ft = document.getElementById(footerId).offsetTop;
90		//ƒtƒbƒ^[‚̍‚‚³
91		var fh = document.getElementById(footerId).offsetHeight;
92		//ƒEƒBƒ“ƒhƒE‚̍‚‚³
93		if (window.innerHeight){
94			var wh = window.innerHeight;
95		}else if(document.documentElement && document.documentElement.clientHeight != 0){
96			var wh = document.documentElement.clientHeight;
97		}
98		if(ft+fh<wh){
99			document.getElementById(footerId).style.position = "relative";
100			document.getElementById(footerId).style.top = (wh-fh-ft-1)+"px";
101		}
102	}
103	
104	//•¶ŽšƒTƒCƒY
105	function checkFontSize(func){
106	
107		//”»’è—v‘f‚̒ljÁ	
108		var e = document.createElement("div");
109		var s = document.createTextNode("S");
110		e.appendChild(s);
111		e.style.visibility="hidden"
112		e.style.position="absolute"
113		e.style.top="0"
114		document.body.appendChild(e);
115		var defHeight = e.offsetHeight;
116		
117		//”»’èŠÖ”
118		function checkBoxSize(){
119			if(defHeight != e.offsetHeight){
120				func();
121				defHeight= e.offsetHeight;
122			}
123		}
124		setInterval(checkBoxSize,1000)
125	}
126	
127	//ƒCƒxƒ“ƒgƒŠƒXƒi[
128	function addEvent(elm,listener,fn){
129		try{
130			elm.addEventListener(listener,fn,false);
131		}catch(e){
132			elm.attachEvent("on"+listener,fn);
133		}
134	}
135
136	addEvent(window,"load",footerFixed);
137	addEvent(window,"load",function(){
138		checkFontSize(footerFixed);
139	});
140	addEvent(window,"resize",footerFixed);
141	
142}
143
144/* *********************************************** */
145// library book List
146/* *********************************************** */
147function LibraryHeight() {
148	var columnNum = 5;
149	var count = 0
150	var maxHeight = 0;
151	//alert(maxHeight + "+01");
152	$("#libraryList li.active").each(function(){
153		/* reset max row height */
154		maxHeight = (count%columnNum == 0)?0:maxHeight;
155		/* get height */
156		var itemHeight = parseInt($(this).children().children().children("img").height());
157		//alert(itemHeight);
158		maxHeight = (itemHeight > maxHeight)?itemHeight:maxHeight;
159		/* set height */
160		if(!(parseInt(count)+1)%columnNum == 0) {
161			var rowNum = Math.floor(count/columnNum);
162			$("#libraryList > li.active:eq(" + parseInt(rowNum*5+0) + ") > a .book").css("height",parseInt(maxHeight) + "px").css("line-height",parseInt(maxHeight) + "px");
163			$("#libraryList > li.active:eq(" + parseInt(rowNum*5+1) + ") > a .book").css("height",parseInt(maxHeight) + "px").css("line-height",parseInt(maxHeight) + "px");
164			$("#libraryList > li.active:eq(" + parseInt(rowNum*5+2) + ") > a .book").css("height",parseInt(maxHeight) + "px").css("line-height",parseInt(maxHeight) + "px");
165			$("#libraryList > li.active:eq(" + parseInt(rowNum*5+3) + ") > a .book").css("height",parseInt(maxHeight) + "px").css("line-height",parseInt(maxHeight) + "px");
166			$("#libraryList > li.active:eq(" + parseInt(rowNum*5+4) + ") > a .book").css("height",parseInt(maxHeight) + "px").css("line-height",parseInt(maxHeight) + "px");
167		}
168		count++;
169	});
170}
171function LibraryBtn() {
172	var index = 0;
173	$('#bookList .btn').fadeOut('fast').promise().done(function(){
174		$('#bookList .btn').each(function(){
175			$(this).delay(index * 50).fadeIn('slow');
176			index++;
177		});
178	});
179}
180function itemClick() {
181	thisItem = $(this).attr('data-country');
182	var index = 0;
183	$('#libraryList li').removeClass('active');
184	if(thisItem != 'all'){
185		$('#libraryList li[data-country='+thisItem+']').addClass('active');
186	}else{
187		$('#libraryList li').addClass('active');
188	}
189	$('#libraryList li').fadeOut('fast').promise().done(function(){
190		$('#libraryList li.active').each(function(){
191			$(this).delay(index * 50).fadeIn('slow');
192			index++;
193		});
194	});
195	LibraryHeight();
196	LibraryBtn();
197	return false;
198}
199
200function itemClickBook() {
201	thisItem = $(this).attr('data-book');
202	var index = 0;
203	$('#libraryList li').removeClass('active');
204	if(thisItem != 'all'){
205		$('#libraryList li[data-book='+thisItem+']').addClass('active');
206	}else{
207		$('#libraryList li').addClass('active');
208	}
209	$('#libraryList li').fadeOut('fast').promise().done(function(){
210		$('#libraryList li.active').each(function(){
211			$(this).delay(index * 50).fadeIn('slow');
212			index++;
213		});
214	});
215	LibraryHeight();
216	LibraryBtn();
217	return false;
218}
219
220
221/* *********************************************** */
222// News List
223/* *********************************************** */
224	
225function itemClickNews() {
226	thisItem = $(this).attr('data-category');
227	var index = 0;
228	$('.newsList li').removeClass('active');
229	if(thisItem != 'all'){
230		$('.newsList li[data-category='+thisItem+']').addClass('active');
231	}else{
232		$('.newsList li').addClass('active');
233	}
234	$('.newsList li').fadeOut('fast').promise().done(function(){
235		$('.newsList li.active').each(function(){
236			$(this).delay(index * 50).fadeIn('slow');
237			index++;
238		});
239	});
240	return false;
241}
242
243/* *********************************************** */
244// rental Btn
245/* *********************************************** */
246$(function(){
247	var pbBtn01 = false;
248	$("#rentalAgrry input").attr('checked' , false);
249	$(".rentalBtnOn").css("display", "none");
250	
251	$("#rentalAgrry input").change(function(){
252		if($(this).is(":checked")){pbBtn01 =true;}else{pbBtn01 =false;}
253		checkAgreement();
254	});
255
256	function checkAgreement(){
257		if(pbBtn01==true){
258			$(".rentalBtnOn").css("display","block");
259			$(".rentalBtnOff").css("display","none");
260		 }else{
261			$(".rentalBtnOn").css("display", "none");
262			$(".rentalBtnOff").css("display","block");
263		}
264	}
265});
266
267
268/* *********************************************** */
269// category
270/* *********************************************** */
271$(function(){
272	if($("#newsCategory > li").length == 1){
273			$("#newsCategory > li").hide();
274	}
275});
276
277/* *********************************************** */
278// personal
279/* *********************************************** */
280$(function(){
281	if($("body#personal").length == 1){
282		buttonText = $('#mainContents .special button').text();
283		$('#mainContents .special button').click(function(){
284			if ($(this).text() == '閉じる') {
285				$(this).html('<img src="/images/personal/ico-arrow-down.png" alt="" />' + buttonText);
286			} else {
287				$(this).html('<img src="/images/personal/ico-arrow-up.png" alt="" />閉じる');
288			}
289			$('#mainContents .special .comment-wrap').slideToggle();
290		});
291	}
292});

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.