PageSourceSearch

https://mynavi-agent.jp/resource/common/js/common_sp_20200217.js

js mynavi-agent.jp collected 2026-09-24 17:52:02 UTC 7,627 bytes, 262 lines download raw bytes

1$(function(){
2	//ページトップへ
3	$(".magPageTop").click(function () {
4		$('html,body').animate({ scrollTop: 0 },'slow','swing');
5		return false;
6	});
7	//ページ内アンカーリンク
8	$(".pageALink").click(function () {
9		var href= $(this).attr("href");
10		var target = $(href == "#" || href == "" ? 'html' : href);
11		var position = target.offset().top;
12		$('html,body').animate({scrollTop:position},'slow','swing');
13		return false;
14	});
15
16	//パンくずスワイプ処理
17	if($('.pankuzuInner').size() != 0){
18		var panWrapWidth = $('.pankuzu').outerWidth(),
19			lastPos      = $('.pankuzuInner h3:last-child').position().left,
20			lastWidth    = $('.pankuzuInner h3:last-child').outerWidth(),
21			panAllWidth  = lastPos + lastWidth;
22
23		if(panWrapWidth < panAllWidth){
24			pzSwipe();
25		}
26	};
27	function pzSwipe(){
28		var rightMax = panWrapWidth - panAllWidth;
29		var isTouch = ('ontouchstart' in window);
30
31		$('.pankuzu').addClass('rightON');
32
33		$('.pankuzuInner a').click(function () {
34			location.href = $(this).attr('href');
35			return false;
36		});
37
38		$('.pankuzuInner').on({
39			'touchstart mousedown': function(e) {
40				this.startX = (isTouch ? event.changedTouches[0].pageX : e.pageX);
41				this.pageX = (isTouch ? event.changedTouches[0].pageX : e.pageX);
42				this.left = $(this).position().left;
43				this.touched = true;
44			},
45			'touchmove mousemove': function(e) {
46				if (!this.touched) { return; }
47				e.preventDefault();
48
49				this.left = this.left - (this.pageX - (isTouch ? event.changedTouches[0].pageX : e.pageX) );
50				if(this.left <= (panWrapWidth*.7) && this.left >= rightMax - (panWrapWidth*.7)){
51					$(this).css('left',this.left);
52				}
53
54				var panWrap = $(this).closest('.pankuzu');
55				this.left < 0 ? panWrap.addClass('leftON') : panWrap.removeClass('leftON');
56				this.left > rightMax ? panWrap.addClass('rightON') : panWrap.removeClass('rightON');
57
58				this.pageX = (isTouch ? event.changedTouches[0].pageX : e.pageX);
59
60			},
61			'touchend mouseup': function(e) {
62				if (!this.touched) { return; }
63
64				this.touched = false;
65				this.left = $(this).position().left;
66
67				if(this.left > 0){
68					$(this).animate({'left': '0px'}, 350);
69				}else if(this.left < rightMax){
70					$(this).animate({'left': rightMax+'px'}, 350);
71				};
72			}
73		});
74	};
75});
76
77/* ハンバーガーメニュー */
78$(window).on('load', function() {
79	let documentHeight = $(document).height();
80	let flag = true;
81	$("#spTabMenuBtn").click(function(){
82		if (flag) {
83			$(this).addClass("is-active");
84			$('#modalBg').addClass("is-active");
85			$(".spNav").stop().css({
86				top: "54px",
87				right: 0,
88				"box-shadow":" -5px 10px 15px 0px rgba(0,0,0,0.4)"
89			});
90			$(".headerArea").stop().css({
91				overflow: "initial"
92			});
93			$("#modalBg").stop().css({
94				top: "54px",
95				height: documentHeight - 54 + "px",
96				right: 0
97			});
98			flag = false;
99		}else {
100			$(this).removeClass("is-active");
101			$('#modalBg').removeClass("is-active");
102			$(".spNav").stop().css({
103				top: "54px",
104				right: "-100%",
105				"box-shadow":"none"
106			});
107			$(".headerArea").stop().css({
108				overflow: "hidden"
109			});
110			$("#modalBg").stop().css({
111				right: "-100%"
112			});
113			flag = true;
114		}
115	});
116	$("#modalBg").click(function(){
117		$(this).removeClass("is-active");
118		$('#spTabMenuBtn').removeClass("is-active");
119		$(".spNav").stop().css({
120			top: "54px",
121			right: "-100%",
122			"box-shadow":"none",
123		});
124		$(".headerArea").stop().css({
125			overflow: "hidden"
126		});
127		$("#modalBg").stop().css({
128			right: "-100%"
129		});
130		flag = true;
131	});
132});
133
134/* アコーディオン */
135$(function(){
136	$('.spAccordionJS:not(".spAActive") + div').hide();
137	$('.spAccordionJS').each(function(i){
138		var elementVal = $(this).next('div');
139		$(this).click(function(){
140			$(this).toggleClass('spAActive');
141			elementVal.slideToggle('normal');
142		});
143	});
144});
145
146/* 新デザインSP版ハンバーガーメニュー内アコーディオン */
147( function( $ ) {
148  $(function(){
149    $(".spHead-acd-btn").click(function(){
150      $(this).toggleClass('open');
151      $(this).next(".spHead-acd-target").slideToggle();
152    });
153  });
154} )( jQuery );
155
156/* 検索窓入力フォーム */
157$(function() {
158	var inputPL = $('input.placeholder');
159	inputPL.blur(function(){
160		var $$=$(this);
161		if($$.val()=='' || $$.val()==$$.attr('title')){
162			$$.css('color', '#ccc').val($$.attr('title'));
163		}
164	}).focus(function(){
165		var $$=$(this);
166		if($$.val()==$$.attr('title')){
167			$(this).css('color', '#082a4d').val('');
168		}
169	}).parents('form:first').submit(function(){
170		var $$=inputPL;
171		if($$.val()==$$.attr('title')){
172			$$.triggerHandler('focus');
173		}
174	}).end().blur();
175});
176
177/* 業種別 genre追加 */
178$(window).bind("load", function(){
179	if(document.URL.match(/woman/)) {
180		$("[href='https://mynavi-agent.jp/entry/index.php']").attr("href", "/entry/?genre=9");
181		$("[href='https://mynavi-agent.jp/entry/']").attr("href", "/entry/?genre=9");
182		$("[href='/entry/index.php']").attr("href", "/entry/?genre=9");
183		$("[href='/entry/']").attr("href", "/entry/?genre=9");
184	} else if (document.URL.match(/\/it/)) {
185		$("[href='https://mynavi-agent.jp/entry/index.php']").attr("href", "/entry/?genre=11");
186		$("[href='https://mynavi-agent.jp/entry/']").attr("href", "/entry/?genre=11");
187		$("[href='/entry/index.php']").attr("href", "/entry/?genre=11");
188		$("[href='/entry/']").attr("href", "/entry/?genre=11");
189	} else if (document.URL.match(/\/fashion/)) {
190		$("[href='https://mynavi-agent.jp/entry/index.php']").attr("href", "/entry/?genre=94");
191		$("[href='https://mynavi-agent.jp/entry/']").attr("href", "/entry/?genre=94");
192		$("[href='/entry/index.php']").attr("href", "/entry/?genre=94");
193		$("[href='/entry/']").attr("href", "/entry/?genre=94");
194	} else {
195		$("[href='https://mynavi-agent.jp/entry/index.php']").attr("href", "/entry/?genre=0");
196		$("[href='https://mynavi-agent.jp/entry/']").attr("href", "/entry/?genre=0");
197		$("[href='/entry/index.php']").attr("href", "/entry/?genre=0");
198	}
199});
200
201/* ローカルナビゲーションカレント表示 */
202$(function(){
203	if($('#navLower').length){
204		var url = location.pathname;
205		var file = url.split("/").pop();
206		var linkurl = $('#navLower a[href="'+url+'"]');
207		if(linkurl.length){
208			linkurl.parent().addClass('active');
209		}else{
210			if(file !== '' &&  url.indexOf('index.') >= 0){
211				var re = url.replace(file,'');
212				linkurl = $('#navLower a[href="'+re+'"]');
213				linkurl.parent().addClass('active');
214			}else{
215				$("#navLower li a").each(function(i) {
216					var ll = $(this).attr('href');
217					if(url.indexOf(ll) !== -1){
218						$(this).parent().addClass('active');
219						return false;
220					}
221				});
222			}
223		}
224	}
225});
226
227/* 新着求人情報の表示を5件から3件にする */
228$(function() {
229  var newJobListUl = $('#topNewJobs').find('.newJobList ul');
230
231	newJobListUl.each(function() {
232		var newJobListUlLi = $(this).find('li');
233		newJobListUlLi.eq(3).hide();
234		newJobListUlLi.eq(4).hide();
235	});
236}(jQuery));
237
238$(function() {
239	if ($('#js-matchHeight-knowhow').find('.js-matchHeight').length) {
240		$('#js-matchHeight-knowhow').find('.js-matchHeight').matchHeight();
241	}
242}(jQuery));
243
244/* Footer Accordion */
245$(function() {
246	var footer = $('#magFooter');
247	var link   = footer.find('.magFNList:not(:first-child) > li > a').not('.magFNList:nth-child(3) > li:first-child > a').not('.magFNList:last-child li > a');
248	var title  = footer.find('.magFNList .title');
249
250	link.on('click', function (e) {
251		e.preventDefault();
252		$(this).toggleClass('is-active');
253		$(this).next('ul').slideToggle(300);
254	});
255
256	title.on('click', function (e) {
257		e.preventDefault();
258		$(this).toggleClass('is-active');
259		$(this).next('ul').slideToggle(300);
260	});
261
262}(jQuery));

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.