PageSourceSearch

https://www.sumitomo-rd.co.jp/common/scripts/main.js?ver=1.0.0

js sumitomo-rd.co.jp collected 2026-10-02 10:35:54 UTC 15,169 bytes, 508 lines download raw bytes

1$(window).resize(function () {
2	if (window.innerWidth <= 992 && window.innerWidth >= 986) {
3		location.reload();
4		initAnhor();
5	}
6	if (window.innerWidth <= 992) {
7		$('.has-drop').slideBlock();
8	};
9	emergency_more_pc();
10	header_padding_top();
11	menu_mega();
12	menu_open_sp();
13	sitemap_list_box();
14	foot_nav();
15	dob_onhover();
16	sub_menu_mega();
17});
18
19$(document).ready(initPage);
20function initPage() {
21	slick();
22	conversionImages();
23	mobileMenu();
24	scrollTop();
25	fontResize();
26	$(".map-block #tabs1").mtTabs();
27	$(".redevelopment_detail #tabs1").mtTabs();
28	$(".news-release-tabs").mtTabs();
29	initAnhor();
30	initInquiryForm();
31	sideListOpener();
32	ex_scroll();
33	emergency_more();
34	foot_nav();
35	header_padding_top();
36	menu_mega();
37	dob_onhover();
38	sub_menu_mega();
39}
40
41function slick() {
42	$('.baner .slide-baner').slick({
43		slidesToShow: 1,
44		slidesToScroll: 1,
45		dots: true,
46		arrows: false,
47		autoplay: true,
48		autoplaySpeed: 4000,
49		pauseOnDotsHover: true,
50		speed: 400,
51		fade: true,
52		cssEase: 'linear'
53	});
54}
55function conversionImages() {
56	$('.ir .slide-baner .slide-item, .bg, .pick-up .img, .investors li .block, .services .service-baner, .row .col .img.bg').each(function () {
57		$(this).css('background-image', 'url(' + $(this).find('> img').attr('src') + ')').find('> img').hide();
58	});
59}
60// function conversionImages() {
61// 	$('.slide-baner .slide-item, .ir .slide-baner .slide-item, .bg, .pick-up .img, .investors li .block, .services .service-baner, .row .col .img.bg').each(function () {
62// 		$(this).css('background-image', 'url(' + $(this).find('> img').attr('src') + ')').find('> img').hide();
63// 	});
64// }
65function mobileMenu() {
66	/*$('<ul class="sp-nav"><li><a href="#" class="open-search-menu mf_finder_searchBox_submit"><span></span></a></li><li><a href="#" class="open-menu"><span></span>Open Menu</a></li></ul>').prependTo('#header > .container > .head');*/
67	$('<span class="fader"/>').appendTo('#wrapper');
68	$('.open-menu, .close').click(function () {
69		$('body').toggleClass('menu-opened');
70		$('body').removeClass('menu-opened-search');
71		return false;
72	});
73	$('.open-search-menu').click(function () {
74		$('body').toggleClass('menu-opened-search');
75		$('body').removeClass('menu-opened');
76		return false;
77	});
78	$('.fader').click(function () {
79		$('body').removeClass('menu-opened');
80	});
81	$('.form-search form').submit(function () {
82		$('body').removeClass('menu-opened');
83	});
84	$('#header .nav li a').click(function () {
85		$('body').removeClass('menu-opened');
86	});
87	$('.nav > li a').click(function () {
88		$('.nav > li').removeClass('active');
89		$(this).parents('li').addClass('active');
90	});
91	if (window.innerWidth <= 992) {
92		$('.has-drop').slideBlock();
93	};
94	$(document).on('touchmove', function (event) {
95		if ($('body').hasClass('menu-opened') && $(window).width() < 992) {
96			if ($('.main-nav').has(event.target).length) {
97				return true;
98			} else {
99				event.preventDefault();
100			}
101		}
102	});
103}
104function scrollTop() {
105	$(window).scroll(function () {
106		if ($(this).scrollTop() > 100) {
107			$('#up-arrow').fadeIn();
108		} else {
109			$('#up-arrow').fadeOut();
110		}
111	});
112	$('#up-arrow').click(function () {
113		$('html, body').animate({ scrollTop: 0 }, 800);
114		return false;
115	});
116}
117function fontResize() {
118	if($('html').hasClass('-english')){
119		var min = 14;
120		var max = 18;
121	} else {
122		var min = 14;
123		var max = 18;
124	}
125	var reset = $('html').css('fontSize');
126	var elm = $('html');
127	var size = str_replace(reset, 'px', '');
128	var size_reset = size;
129	$('a.js_size_plus').click(function () {
130		$(this).toggleClass('active').prev().removeClass('active');
131		if (size <= max) {
132			size = max;
133			elm.css({ 'fontSize': size });
134		}
135		return false;
136	});
137	$('a.js_size_minus').click(function () {
138		if (size >= min) {
139			size--;
140			elm.css({ 'fontSize': size });
141		}
142		return false;
143	});
144	$('a.fontReset').click(function () {
145		$(this).toggleClass('active').next().removeClass('active');
146		size = size_reset;
147		//elm.css({'fontSize' : reset});
148		elm.removeAttr('style');
149		return false;
150	});
151}
152function anchor() {
153	var headerHeight = $('header').outerHeight();
154	$(".anchor").click(function (e) {
155		var href = $(this).attr("href"),
156			offsetTop = href === "#" ? 0 : $(href).offset().top;
157		$("html, body").stop().animate({
158			scrollTop: offsetTop - headerHeight
159		}, 5100);
160		e.preventDefault();
161	});
162};
163(function ($) {
164	$.fn.mtTabs = function (options) {
165		var options = $.extend({
166			item: 'a[data-role=tablink]',
167			activeTabClass: 'active',
168			onStart: null
169		}, options);
170		this.each(function () {
171			var $this = $(this);
172			var items = $(options.item, $this);
173			if (!items.length) return;
174			items.bind('click', function () {
175				showTab($(this));
176				return false;
177			});
178			if ($.isFunction(options.onStart)) options.onStart($this);
179			items.filter(':first').click();
180			function showTab(link) {
181				var tab = link.attr('href');
182				items.each(function () {
183					if (link.attr('href') != $(this).attr('href')) {
184						$(this).removeClass(options.activeTabClass);
185					} else {
186						$(this).addClass(options.activeTabClass);
187					}
188					if ($(this).attr('href') != '#') {
189						$($(this).attr('href')).hide();
190					}
191				});
192				jQuery(tab).show();
193			}
194		});
195		return this;
196	}
197})(jQuery);
198function str_replace(haystack, needle, replacement) {
199	var temp = haystack.split(needle);
200	return temp.join(replacement);
201}
202function initInquiryForm() {
203	$('#jform input, #jform textarea, #jform select').not('[type=submit]')
204		.on('input', function (e) {
205			$(e.target).removeClass('invalid');
206			e.target.setCustomValidity("");
207		})
208		.on('invalid', function (e) {
209			$('.error-popup, .popup-fader').removeClass('hidden');
210			$(e.target).addClass('invalid');
211			e.target.setCustomValidity(" ");
212		});
213	$('#jform select').on('change', function (e) {
214		$(e.target).removeClass('invalid');
215		e.target.setCustomValidity("");
216		$('option', this).removeAttr('selected');
217		$('option[value=' + this.value + ']', this).attr('selected', 'selected');
218	});
219	$('.error-popup .close-popup').click(function () {
220		$('.error-popup, .popup-fader').addClass('hidden');
221	});
222}
223function sideListOpener() {
224	$('.years-list .all a').click(function (e) {
225		e.preventDefault();
226		var elem = $('.years-list li.visible');
227		$(this).parents().find('.visible').slideUp().removeClass('visible');
228		$(this).parents().find('li').not(":visible").slideDown().addClass('visible');
229		$(this).text(elem.is(':visible') ? '過去のニュース' : '閉じる');
230		return false;
231	});
232}
233function initAnhor() {
234	var headerHeight = $('header').outerHeight();
235	if (window.innerWidth > 992) {
236		$('.list-anhor-link a[href *= "#"]').click(function (e) {
237			e.preventDefault();
238			var anChorThis = $(this).attr('href');
239			var postionScroll = $(anChorThis).offset().top;
240			$('body,html').animate({ scrollTop: postionScroll - headerHeight }, 1500);
241		});
242		$('.link-boxes a[href *= "#"]').click(function (e) {
243			e.preventDefault();
244			var anChorThis = $(this).attr('href');
245			var postionScroll = $(anChorThis).offset().top;
246			$('body,html').animate({ scrollTop: postionScroll - headerHeight }, 1500);
247		});
248		$('.links-list-child li a[href *= "#"]').click(function (e) {
249			var anChorThis = $(this).attr('href').split('#')[1];
250			var postionScroll = $('#' + anChorThis).offset().top;
251			$('body,html').animate({ scrollTop: postionScroll - headerHeight }, 1500);
252		});
253		$('.tabs-list a[href *= "#"]').not('.redevelopment_detail .tabs-list a[href *= "#"],.map-block .tabs-list a[href *= "#"]').click(function (e) {
254			var anChorThis = $(this).attr('href').split('#')[1];
255			var postionScroll = $('#' + anChorThis).offset().top;
256			$('body,html').animate({ scrollTop: postionScroll - headerHeight }, 1500);
257		});
258		$('.company-recruit-box a.-recruit[href *= "#"]').click(function (e) {
259			var anChorThis = $(this).attr('href').split('#')[1];
260			var postionScroll = $('#' + anChorThis).offset().top;
261			$('body,html').animate({ scrollTop: postionScroll - headerHeight }, 1500);
262		});
263		$('.okyakusama-block .l_cat_list a[href *= "#"]').click(function (e) {
264			var anChorThis = $(this).attr('href').split('#')[1];
265			var postionScroll = $('#' + anChorThis).offset().top;
266			$('body,html').animate({ scrollTop: postionScroll - headerHeight }, 1500);
267		});
268	}
269	if (window.innerWidth <= 991) {
270		$('.list-anhor-link a[href *= "#"]').click(function (e) {
271			e.preventDefault();
272			var anChorThis = $(this).attr('href');
273			var postionScroll = $(anChorThis).offset().top;
274			$('body,html').animate({ scrollTop: postionScroll - headerHeight - 10 }, 1500);
275		});
276		$('.link-boxes a[href *= "#"]').click(function (e) {
277			e.preventDefault();
278			var anChorThis = $(this).attr('href');
279			var postionScroll = $(anChorThis).offset().top;
280			$('body,html').animate({ scrollTop: postionScroll - headerHeight - 10 }, 1500);
281		})
282		$('.links-list-child li a[href *= "#"]').click(function (e) {
283			var anChorThis = $(this).attr('href').split('#')[1];
284			var postionScroll = $('#' + anChorThis).offset().top;
285			$('body,html').animate({ scrollTop: postionScroll - headerHeight - 10 }, 1500);
286		});
287		$('.tabs-list a[href *= "#"]').not('.redevelopment_detail .tabs-list a[href *= "#"],.map-block .tabs-list a[href *= "#"]').click(function (e) {
288			var anChorThis = $(this).attr('href').split('#')[1];
289			var postionScroll = $('#' + anChorThis).offset().top;
290			$('body,html').animate({ scrollTop: postionScroll - headerHeight - 10 }, 1500);
291		});
292		$('.company-recruit-box a.-recruit[href *= "#"]').click(function (e) {
293			var anChorThis = $(this).attr('href').split('#')[1];
294			var postionScroll = $('#' + anChorThis).offset().top;
295			$('body,html').animate({ scrollTop: postionScroll - headerHeight - 10 }, 1500);
296		});
297		$('.okyakusama-block .l_cat_list a[href *= "#"]').click(function (e) {
298			var anChorThis = $(this).attr('href').split('#')[1];
299			var postionScroll = $('#' + anChorThis).offset().top;
300			$('body,html').animate({ scrollTop: postionScroll - headerHeight - 10 }, 1500);
301		});
302	}
303}
304
305function emergency_more() {
306	$(".sp-more").on("click",function(){
307		if($(this).hasClass("-more")){
308			$(this).prev().removeClass("-limit");
309			$(this).removeClass("-more");
310			$(this).addClass("-close");
311			$(this,"span").text("close");
312		} else if($(this).hasClass("-close")){
313			$(this).prev().addClass("-limit");
314			$(this).removeClass("-close");
315			$(this).addClass("-more");
316			$(this,"span").text("more");
317		}
318	});
319};
320
321function emergency_more_pc() {
322	if (window.innerWidth > 768) {
323		if($(".sp-more").hasClass("-close")){
324			$(".sp-more").prev().addClass("-limit");
325			$(".sp-more").removeClass("-close");
326			$(".sp-more").addClass("-more");
327			$(".sp-more").text("more");
328		}
329	}
330};
331/* Slide Block */
332(function ($) {
333	$.fn.slideBlock = function (options) {
334		$(".nav li.has-drop .drop-box").hide().prev().click(function (e) {
335			e.stopImmediatePropagation();
336			$(this).parents(".nav").find(".drop-box").not(this).slideUp(500).prev().removeClass("active");
337			$(this).next().not(":visible").slideDown(500).prev().addClass("active");
338		});
339	};
340})(jQuery);
341
342var OnScroll_a = function () {
343
344	$(document).ready(function () {
345		setTimeout(OnScroll, 300);
346	});
347	var headerHeight = $('header').outerHeight();
348	if (window.location.pathname.indexOf('/search/') === -1) {
349		if (window.location.hash) {
350			window.hash = window.location.hash.substr(1);
351			window.location.hash = '';
352		}
353	}
354	function OnScroll() {
355		if (window.hash) {
356			var scrollPos = $('#' + window.hash).offset().top;
357			if (window.innerWidth <= 991) scrollPos -= document.querySelector('#header').offsetHeight;
358			console.dir(scrollPos);
359			$("html, body").animate({ scrollTop: scrollPos - headerHeight }, 1000);
360		}
361	};
362
363}();
364
365function ex_scroll() {
366	var footer = document.querySelector('.footer-bar');
367	if (footer) {
368		footer.addEventListener('click', function (event) {
369			var _buff = null;
370			if (event.target.closest('a')) {
371				_buff = event.target.closest('a').getAttribute('href').slice(-4, -1);
372			}
373			if (_buff == '#ex') location.reload();
374		})
375	}
376}
376;
377
378$(function () {
379	$("a[href*='.pdf']").attr("target", "_blank");
380
381	$('.topics-list a[href^=http]').not('[href*="' + location.hostname + '"]').attr('target', '_blank');
382
383});
384
385
386/*
387	By Osvaldas Valutis, www.osvaldas.info
388	Available for use under the MIT License
389*/
390
391
392
393; (function ($, window, document, undefined) {
394	if (window.innerWidth <= 992) {
395		return;
396	}
397	$.fn.doubleTapToGo = function (params) {
398		if (!('ontouchstart' in window) &&
399			!navigator.msMaxTouchPoints &&
400			!navigator.userAgent.toLowerCase().match(/windows phone os 7/i)) return false;
401
402		this.each(function () {
403			var curItem = false;
404
405			$(this).on('click', function (e) {
406				var item = $(this);
407				if (item[0] != curItem[0]) {
408					e.preventDefault();
409					curItem = item;
410				}
411			});
412
413			$(document).on('click touchstart MSPointerDown', function (e) {
414				var resetItem = true,
415					parents = $(e.target).parents();
416
417				for (var i = 0; i < parents.length; i++)
418					if (parents[i] == curItem[0])
419						resetItem = false;
420
421				if (resetItem)
422					curItem = false;
423			});
424		});
425		return this;
426	};
427})(jQuery, window, document);
428
429$(function () {
430	$("li.menu_mega").doubleTapToGo();
431});
432
433function foot_nav() {
434	if (window.innerWidth < 768) {
435		$('.-foot-nav .-js_sp_foot_toggle').off('click');
436		$('.-foot-nav .-js_sp_foot_toggle').click(function(){
437			$(this).toggleClass('-active');
438			$(this).parent().next('.sitemap-list-box').slideToggle();
439			return false;
440		});
441	} else {
442		$('.-foot-nav .-js_sp_foot_toggle').off('click');
443		$('.sitemap-list-box').show();
444	}
445};
446
447function header_padding_top() {
448	var headerHeight = $('header').outerHeight();
449	var navHeight = $('.main-nav .nav').outerHeight();
450	var subnavHeight = $('.sub-nav').outerHeight();
451	$('body').css('padding-top', headerHeight + 'px');
452	if (window.innerWidth < 992) {
453		$('.nav .drop-box').removeAttr('style');
454		$('.sub-nav .drop-box').removeAttr('style');
455		$('.search-box-sp').css('top', headerHeight + 'px');
456		$('.main-nav').css('top', headerHeight + 'px');
457	} else {
458		$('.nav .drop-box').css('top', navHeight + 'px');
459		$('.sub-nav .drop-box').css('top', subnavHeight + 'px');
460		$('.search-box-sp').removeAttr();
461		$('.main-nav').removeAttr('style');
462	}
463};
464
465function menu_mega() {
466	if (window.innerWidth > 991) {
467		$('li.menu_mega').hover(
468			function() {
469				$('#wrapper').addClass('is-menu_mega-open');
470			},
471			function() {
472				$('#wrapper').removeClass('is-menu_mega-open');
473			}
474		);
475	} else {
476		$('#wrapper').removeClass('is-menu_mega-open');
477	}
478};
479
480function menu_open_sp() {
481	if(window.innerWidth > 991){
482		$('body').removeClass('menu-opened');
483		$('body').removeClass('menu-opened-search');
484	}
485};
486
487function sitemap_list_box() {
488	if(window.innerWidth > 766){
489		$('.sitemap-list-box').removeAttr('style');
490		$('.-js_sp_foot_toggle').removeClass('-active');
491	}
492}
493
494function dob_onhover() {
495	var doblistHeight = $('.dob-list li').outerHeight();
496	$('.dob-list li .onhover').css('top', doblistHeight + 'px');
497}
498
499function sub_menu_mega(){
500  $('.sub-nav .has-drop').hover(
501    function () {
502      $(this).find('.drop-box').stop(true, true).fadeIn(200);
503    },
504    function () {
505      $(this).find('.drop-box').stop(true, true).fadeOut(200);
506    }
507  );
508};

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.