PageSourceSearch

https://www.kawabe.co.jp/_pack/js/base.js

js kawabe.co.jp collected 2026-10-02 07:34:04 UTC 13,348 bytes, 454 lines download raw bytes

1document.write('<script src="/_pack/js/jQueryAutoHeight.js"></script>');
2document.write('<script src="/_pack/js/jquery.waypoints.js"></script>');
3document.write('<script src="/_pack/js/jquery.featureList-1.0.0.js"></script>');
4document.write('<script src="/_pack/js/jquery.cookie.js"></script>');
5
6
7var wW = $(window).width();
8var wH = $(window).height();
9var spW = 740;
10var devPC = false;
11var devPCTB = false;
12var devTB = false;
13var devSP = false;
14var devTBSP = false;
15
16var purl;
17var host;
18var relative;
19var path;
20var directory;
21var dir;
22
23$(function(){
24	purl = $.url();
25	host = purl.attr('host');
26	relative = purl.attr('relative');
27	path = purl.attr('path');
28	query = purl.attr('query');
29	directory = purl.attr('directory');
30	dir = directory.split( '/' );
31	/* ?age=20 → purl.param('age'); →20 */
32});
33
34
35
36/* --------------------------------------------------
37/// デバイス・OS・ブラウザ 判別
38-------------------------------------------------- */
39
40$(function(){
41
42	var _ua = (function(u){
43	return {
44		Tablet:(u.indexOf("windows") != -1 && u.indexOf("touch") != -1 && u.indexOf("tablet pc") == -1)
45			|| u.indexOf("ipad") != -1
46			|| (u.indexOf("android") != -1 && u.indexOf("mobile") == -1)
47			|| (u.indexOf("firefox") != -1 && u.indexOf("tablet") != -1)
48			|| u.indexOf("kindle") != -1
49			|| u.indexOf("silk") != -1
50			|| u.indexOf("playbook") != -1,
51		Mobile:(u.indexOf("windows") != -1 && u.indexOf("phone") != -1)
52			|| u.indexOf("iphone") != -1
53			|| u.indexOf("ipod") != -1
54			|| (u.indexOf("android") != -1 && u.indexOf("mobile") != -1)
55			|| (u.indexOf("firefox") != -1 && u.indexOf("mobile") != -1)
56			|| u.indexOf("blackberry") != -1
57	}
58	})(window.navigator.userAgent.toLowerCase());
59
60
61	if(_ua.Mobile){
62		$("html").addClass("sp");
63		devSP = true;
64	}
65	if(_ua.Tablet){
66		$("html").addClass("tb");
67		devTB = true;
68	}
69	if(!_ua.Mobile && !_ua.Tablet){
70		$("html").addClass("pc");
71		devPC = true;
72	}
73	if(!_ua.Mobile){
74		$("html").addClass("pctb");
75		devPCTB = true;
76		devPC = true;
77	}
78	if(_ua.Mobile || _ua.Tablet){
79		$("html").addClass("tbsp");
80		devTBSP = true;
81	}
82
83	if (navigator.platform.indexOf("Mac") != -1) {
84		$("html").addClass("mac");
85	}
86
87	var ua = navigator.userAgent;
88	if(ua.match(/MSIE/) || ua.match(/Trident/)) {
89		$("html").addClass('ie');
90	}
91	var isIE = ua.match(/msie/i),
92		isIE6 = ua.match(/msie [6.]/i),
93		isIE7 = ua.match(/msie [7.]/i),
94		isIE8 = ua.match(/msie [8.]/i),
95		isIE9 = ua.match(/msie [9.]/i),
96		isIE10 = ua.match(/msie [10.]/i),
97		isChrome = ua.match(/chrome/i),
98		isSafari = ua.match(/safari/i),
99		isfireFox = ua.match(/firefox/i);
100	if (isIE) {
101		if (isIE6) {
102			$("html").addClass('ie6');
103			$("html").addClass('ie8u');
104		} else if (isIE7) {
105			$("html").addClass('ie7');
106			$("html").addClass('ie8u');
107		} else if (isIE8) {
108			$("html").addClass('ie8');
109			$("html").addClass('ie8u');
110		} else if (isIE9) {
111			$("html").addClass('ie9');
112		} else if (isIE10) {
113			$("html").addClass('ie10');
114		}
115	}else if(isChrome){
116		$("html").addClass('chrome');
117	}else if(isSafari){
118		$("html").addClass('safari');
119	}else if(isfireFox){
120		$("html").addClass('firefox');
121	}
122	if(ua.search(/iPhone/) != -1){
123		$("html").addClass('iPhone');
124		$("html").addClass('iOS');
125	} else if(ua.search(/iPad/) != -1){
126		$("html").addClass('iPad');
127		$("html").addClass('iOS');
128	}else if(ua.search(/Android/) != -1){
129		$("html").addClass('Android');
130	}
131 });
132
133
134/* --------------------------------------------------
135/// print
136-------------------------------------------------- */
137$(function(){
138	var print = false;
139	if(purl.param('view')) {
140		if(purl.param('view') == "print") {
141			$("body").addClass("print");
142		}
143	}
144});
145
146
147/* --------------------------------------------------
148/// body default
149-------------------------------------------------- */
150$(function(){
151	$('#ContentsWrap').waypoint(function(direction) {
152		if(direction == 'up') {
153			$("body").addClass("default");
154		} else {
155			$("body").removeClass("default");
156		}
157	}, { offset: '-0%' });
158});
159
160
161/* --------------------------------------------------
162/// tabChange
163-------------------------------------------------- */
164$(window).load(function() {
165	if(0 < $('.tabChange').size()){
166		$('.tabChange').each(function(i){
167			var Start = 0;
168			$(".tabBtnWrap a.tab",this).each(function(s){
169				if ($(this).is('.start')) {
170					Start = s;
171				}
172			});
173			$.featureList(
174				$("a.tab",this),
175				$(".tabContents",this), {
176					start_item	:	Start,
177					fade_in	:	400,
178					interval : 0,
179					fadesame	:	false,
180					event	:	"click"
181			});
182		});
183	}
184});
185
186/* --------------------------------------------------
187/// PageTop
188-------------------------------------------------- */
189$(function() {
190	var topBtn = $('.pageTop');
191	var showFlug = false;
192	topBtn.click(function () {
193		$('body,html').animate({scrollTop: 0}, 300);
194		return false;
195	});
196});
197
198/* --------------------------------------------------
199/// link scroll
200-------------------------------------------------- */
201$(window).load(function(){
202	$("a.pageLink").click(function(i){
203		var anch = $(this).attr("href");
204		if(devPCTB) {
205			$('html,body').animate({ scrollTop:  $(anch).offset().top-50});
206		} else if(devSP) {
207			$('html,body').animate({ scrollTop:  $(anch).offset().top-25});
208		}
209	});
210
211	var url = $(location).attr('href');
212	if(url.indexOf("?anch=") != -1){
213		var id = url.split("?anch=");
214		var $target = $('#' + id[id.length - 1]);
215		if($target.length){
216			if(devPCTB) {
217				var pos = $target.offset().top-60;
218			} else if(devSP) {
219				var pos = $target.offset().top-30;
220			}
221			$("html, body").animate({scrollTop:pos}, 300);
222		}
223	}
224});
225
226/* --------------------------------------------------
227/// lightbox_contents
228-------------------------------------------------- */
229$(function(){
230	var scrollTop = 0;
231	$(".lightbox_contents .closeBg, .lightbox_contents .closeBtn, .lightbox_contents .box a").bind('click',function(e){
232		$(this).parents(".lightbox_contents").removeClass("open");
233		lightbox_close();
234	});
235	$(".lightbox_btn").click(function () {
236			var _class = $(this).attr("data-lb");
237			scrollTop = $(window).scrollTop();
238			$('#Container').css({'position':'fixed','top':-scrollTop});
239			$(".lightbox_contents."+_class).addClass("open");
240	});
241
242	function lightbox_close(){
243		$('#Container').css({'position':'relative','top':'auto'});
244		$('html,body').scrollTop(scrollTop);
245	}
246});
247
248
249
250/* --------------------------------------------------
251/// 開閉式
252-------------------------------------------------- */
253$(window).load(function() {
254	$(".slideOpenBtn").each(function() {
255		if ($(this).is('.open')) {
256			$(".cl",this).hide();
257		} else {
258			$(".op",this).hide();
259		}
260	});
261	$(".slideOpenBtn.open").each(function() {
262		var index = $(".slideOpenBtn").index(this);
263		$(".slideOpenBox:eq("+index+")").show();
264	});
265	$(".slideOpenBtn").click(function () {
266		var index = $(".slideOpenBtn").index(this);
267		$(this).toggleClass("open");
268		$(".slideOpenBox:eq("+index+")").slideToggle();
269		$(".op", this).toggle();
270		$(".cl", this).toggle();
271	});
272
273
274	$(".parentSlideOpenBtn").each(function() {
275		if ($(this).is('.open')) {
276			$(".cl",this).hide();
277		} else {
278			$(".op",this).hide();
279		}
280	});
281	$(".parentSlideOpenBtn.open").each(function() {
282		var index = $(".parentSlideOpenBtn").index(this);
283		$(".parentSlideOpenBox:eq("+index+")").show();
284	});
285	$(".parentSlideOpenBtn").click(function () {
286		var index = $(".parentSlideOpenBtn").index(this);
287		$(this).toggleClass("open");
288		$(".parentSlideOpenBox:eq("+index+")").slideToggle();
289		$(".op", this).toggle();
290		$(".cl", this).toggle();
291	});
292});
293
294/* --------------------------------------------------
295/// autoHeight
296-------------------------------------------------- */
297$(window).load(function() {
298
299/* --------------------------------------------------
300	if(devPCTB) {
301		$('.pcAutoHCol2').each(function(i){		$(".pcAutoH", this).autoHeight({column:2});	});
302		$('.pcAutoHCol3').each(function(i){		$(".pcAutoH", this).autoHeight({column:3});	});
303		$('.pcAutoHCol4').each(function(i){		$(".pcAutoH", this).autoHeight({column:4});	});
304		$('.pcAutoHCol5').each(function(i){		$(".pcAutoH", this).autoHeight({column:5});	});
305
306		$('.pcAutoHCol2Clear').each(function(i){		$(".pcAutoH", this).autoHeight({column:2,clear:1});
307		$('.pcAutoHCol3Clear').each(function(i){		$(".pcAutoH", this).autoHeight({column:3,clear:1});
308		$('.pcAutoHCol4Clear').each(function(i){		$(".pcAutoH", this).autoHeight({column:4,clear:1});
309		$('.pcAutoHCol5Clear').each(function(i){		$(".pcAutoH", this).autoHeight({column:5,clear:1});
310	}
311	if(devSP) {
312		$('.spAutoHCol2').each(function(i){		$(".spAutoH", this).autoHeight({column:2});	});
313		$('.spAutoHCol3').each(function(i){		$(".spAutoH", this).autoHeight({column:3});	});
314		$('.spAutoHCol4').each(function(i){		$(".spAutoH", this).autoHeight({column:4});	});
315		$('.spAutoHCol5').each(function(i){		$(".spAutoH", this).autoHeight({column:5});	});
316
317		$('.spAutoHCol2Clear').each(function(i){		$(".spAutoH", this).autoHeight({column:2,clear:1});
318		$('.spAutoHCol3Clear').each(function(i){		$(".spAutoH", this).autoHeight({column:3,clear:1});
319		$('.spAutoHCol4Clear').each(function(i){		$(".spAutoH", this).autoHeight({column:4,clear:1});
320		$('.spAutoHCol5Clear').each(function(i){		$(".spAutoH", this).autoHeight({column:5,clear:1});
321	}
322-------------------------------------------------- */
323
324	if(devPCTB) {
325		$('.columnWrap.col2').each(function(i){
326			$(".column", this).autoHeight({column:2,clear:1});
327		});
328		$('.columnWrap.col3').each(function(i){
329			$(".column", this).autoHeight({column:3,clear:1});
330		});
331		$('.columnWrap.col4').each(function(i){
332			$(".column", this).autoHeight({column:4,clear:1});
333		});
334	}  else {
335		$('.autoHeightWrap.col2').each(function(i){
336			$(".autoHeight", this).autoHeight({column:2});
337		});
338		$('.autoHeightWrap.col3').each(function(i){
339			$(".autoHeight", this).autoHeight({column:3});
340		});
341		$('.autoHeightWrap.col4').each(function(i){
342			$(".autoHeight", this).autoHeight({column:4});
343		});
344		$('.autoHeightWrap.col5').each(function(i){
345			$(".autoHeight", this).autoHeight({column:5});
346		});
347		$('.columnWrap.spCol2').each(function(i){
348			$(".column", this).autoHeight({column:2,clear:1});
349		});
350		$('.columnWrap.spCol3').each(function(i){
351			$(".column", this).autoHeight({column:3,clear:1});
352		});
353	}
354});
355
356/* --------------------------------------------------
357/// フォーム 関連
358-------------------------------------------------- */
359$(function(){
360	$('a.formSubmit').click(function(){
361		$(this).parents("form").submit();
362	})
363
364	$('input[type="file"]').on("change", function() {
365		var file = this.files[0];
366		if(file != null) {
367			$(this).next('input[type="text"]').val(file.name)
368		}
369	});
370	$(".inputFileWrap a.clear").click(function (e) {
371		$(this).parents(".inputFileWrap").children('input[type="file"]').val("");
372		$(this).parents(".inputFileWrap").children('input[type="text"]').val("");
373	});
374});
375
376
377/* --------------------------------------------------
378/// formStyleA checkbox radio
379MW WP form
380$(window).load(function() {
381	if(0 < $('.formStyleA').size()){
382		$('.formStyleA input[type="checkbox"]').each(function(i){
383			$(this).parent("label").addClass("checkbox");
384		});
385		$('.formStyleA input[type="checkbox"]').each(function(i){
386			if ($(this).is(':checked')) {
387				$(this).parent('.checkbox').addClass("on");
388			} else {
389				$(this).parent('.checkbox').removeClass("on");
390				$(this).prop("checked",false);
391			}
392		});
393		$('.formStyleA input[type="checkbox"]').on('change', function(){
394			if ($(this).is(':checked')) {
395				$(this).parent('.checkbox').addClass("on");
396			} else {
397				$(this).parent('.checkbox').removeClass("on");
398			}
399		});
400
401		$('.formStyleA input[type="radio"]').each(function(i){
402			$(this).after('<em class="check"></em>');
403		});
404
405	}
406});
407-------------------------------------------------- */
408
409/* --------------------------------------------------
410
411/// その他
412-------------------------------------------------- */
413$(function(){
414	$('a[href=#]').click(function(){
415		return false;
416	})
417});
418
419$(function(){
420	$('.telhref em').each(function(i){
421		$(this).unwrap();
422	});
423});
424
425
426
427
428/* --------------------------------------------------
429/// anch
430-------------------------------------------------- */
431
432$(function () {
433    var flexCards = $(".flex.order");
434    flexCards.each(function () {
435        var flexCard = $(this).children('.item');
436        var colNum = parseInt($(this).width() / flexCard.width());
437				for(var i = 0; i < colNum-1; i++){
438            var fillElement = $('<div class="item hide">', {
439                class: "fill_element"
440            });
441            fillElement.css({
442                height: "0",
443                margin: "0",
444                // width: flexCard.width() + "px",
445                padding: "0"
446            });
447            $(this).append(fillElement);
448        }
449        $(window).resize(function () {
450            fillElements = $(".fill_element");
451            fillElements.width(flexCard.width());
452        });
453    });
454});

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.