PageSourceSearch

https://www.arcsystemworks.jp/portal/wordpress/wp-content/themes/arcsystemworks/js/common.js

js arcsystemworks.jp collected 2026-10-01 11:42:14 UTC 10,488 bytes, 373 lines download raw bytes

1/*
2var url = new String(location.href);
3
4$.ajax({
5	url:"http://urls.api.twitter.com/1/urls/count.json?url=" + encodeURIComponent("http://www" + url.substring(url.indexOf("."), url.length)),
6	dataType:"jsonp",
7	success:function(obj){$(".tw_count").append(obj.count)},
8	error:function(){$(".tw_count").append("0")},
9	complete:function(){return false}
10});
11
12$.ajax({
13	url:"http://graph.facebook.com/?id=" + encodeURIComponent("http://www" + url.substring(url.indexOf("."), url.length)),
14	dataType:"jsonp",
15
16	success:function(obj){
17		if(typeof(obj.shares) == 'undefined'){
18			count = 0;
19		}else{
20			count = obj.shares;
21		}
22		$(".fb_count").append(count);
23	},
24	error:function(){$(".fb_count").append("0")},
25	complete:function(){return false}
26
27});
28*/
29
30
31$(function(){
32  var fixed_header = $('.fixed_header').height();
33  $('body').css({"padding-top":fixed_header + "px"});
34  $(window).resize(function() {
35    var fixed_header = $('.fixed_header').height();
36    $('body').css({"padding-top":fixed_header + "px"});
37  });
38});
39
40$(function(){
41  var li_count = 0;
42  var show_count = 0;
43  if($('.page_news--list').length){
44    li_count = $('.page_news--list li').length;
45    show_count = 21;
46  }
47  if($('.page_game--list').length){
48    li_count = $('.page_game--list li').length;
49    show_count = 8;
50  }
51  
52  if($('.search_sort').length){
53    $('.page_news--list li').show();
54    $('.page_game--list li').show();
55    $(".more.btn").hide();
56  }
57  
58	$(".more.btn").on('click', function(){
59    if($('.page_news--list').length){
60      show_count += 21;
61      $('.page_news--list li:nth-child(-n+' + show_count + ')').show();
62      if(show_count >= li_count){
63        $(this).hide();
64      }
65    }
66    if($('.page_game--list').length){
67      show_count += 16;
68      $('.page_game--list li:nth-child(-n+' + show_count + ')').show();
69      if(show_count >= li_count){
70        $(this).hide();
71      }
72    }
73    
74	});
75});
76
77$(window).on({
78	'scroll':function(){
79		var windowTop = $(this).scrollTop();
80		if(windowTop > 600){
81			$(".toTop").css("opacity", 1);
82		}else {
83			$(".toTop").css("opacity", 0);
84		}
85	}
86});
87
88function toTop() {
89	if($(window).scrollTop() > 0){
90		$("body,html").delay(100).animate({scrollTop: $("#header").height()}, 500);
91	}else{
92		$(".box_show").removeClass("box_show");
93	}
94}
95
96function isSMT(){
97	var blnMobile = false;
98	var agent = navigator.userAgent;
99	if(agent.search(/iPhone/) != -1){
100		blnMobile = true;
101	}else if(agent.search(/iPad/) != -1){
102		blnMobile = true;
103	}else if(agent.search(/Android/) != -1){
104		blnMobile = true;
105	}
106	
107	return blnMobile;
108}
109
110function isBreak(){
111	return $(window).width() <= 640;
112}
113
114// モーダル ------------
115function modalControll(){
116	// ---- 検索 ----
117	//開く動作
118	$(".modal_open_2020").on('click', function(){
119		var modal_name = $(this).data('modal_name');
120		$('#modal_box_2020').fadeIn(100);
121		$('#' + modal_name).fadeIn(200);
122		$('body').css({'overflow-y':'hidden'});
123	});
124	
125	//閉じる動作
126	$("#modal_close_2020").on('click', function(){
127		$('#modal_contents_2020 > div').fadeOut(100);
128		$('#modal_box_2020').fadeOut(200);
129		$('body').css({'overflow-y':'scroll'});
130	});
131	$("#modal_bg_2020").on('click', function(){
132		$('#modal_contents_2020 > div').fadeOut(100);
133		$('#modal_box_2020').fadeOut(200);
134		$('body').css({'overflow-y':'scroll'});
135	});
136	$(".modal_closebox_2020").on('click', function(){
137		$('#modal_contents_2020 > div').fadeOut(100);
138		$('#modal_box_2020').fadeOut(200);
139		$('body').css({'overflow-y':'scroll'});
140	});
141	
142	// ---- アンサー ----
143	//開く動作
144	$(".modal_open_a").on('click', function(){
145		$('#modal_box_faq').fadeIn(100);
146		$('#a_' + $(this).data('id')).fadeIn(200);
147		$('body').css({'overflow-y':'hidden'});
148	});	
149	//閉じる動作
150	$("#modal_close_faq").on('click', function(){
151		$('#modal_contents_faq > .contents').fadeOut(100);
152		$('#modal_box_faq').fadeOut(200);
153		$('body').css({'overflow-y':'scroll'});
154	});
155	$(".modal_closebox_faq").on('click', function(){
156		$('#modal_contents_faq > .contents').fadeOut(100);
157		$('#modal_box_faq').fadeOut(200);
158		$('body').css({'overflow-y':'scroll'});
159	});
160  
161  // ---- ショップページ ----
162	//開く動作
163	$(".modal_open_shop").on('click', function(){
164		$('#modal_box_shop').fadeIn(100);
165		$('#a_' + $(this).data('id')).fadeIn(200);
166		$('body').css({'overflow-y':'hidden'});
167	});	
168	//閉じる動作
169	$("#modal_close_shop").on('click', function(){
170		$('#modal_contents_shop > .contents').fadeOut(100);
171		$('#modal_box_shop').fadeOut(200);
172		$('body').css({'overflow-y':'scroll'});
173	});
174	$(".modal_closebox_shop").on('click', function(){
175		$('#modal_contents_shop > .contents').fadeOut(100);
176		$('#modal_box_shop').fadeOut(200);
177		$('body').css({'overflow-y':'scroll'});
178	});
179}
180modalControll();
181
182// modaltype-link_list ------------
183function modaltypeLinkList(){
184	$(".parent").on('click', function(){
185		if($(this).next().hasClass('child')){
186			if ($(this).hasClass('active')) {
187				$(this).next(".child").slideUp(200);
188				$(this).removeClass('active');
189			}else{
190				$(this).next(".child").slideDown(200);
191				$(this).addClass('active');
192			}
193		}
194	});
195	
196	$(".parent_pulldown").on('click', function(){
197		if($(this).next().hasClass('child')){
198			if ($(this).hasClass('active')) {
199				$(this).next(".child").slideUp(200);
200				$(this).removeClass('active');
201			}else{
202				$(this).next(".child").slideDown(200);
203				$(this).addClass('active');
204			}
205		}
206	});
207}
208modaltypeLinkList();
209
210// 検索の送信
211function submit_search(){
212	$('.submit_search').click(function() {
213		$(this).parent('form').submit();
214	});
215}
216submit_search();
217
218// タブ付き固定ページのタブ設定
219var custom_tab = function() {
220
221  var $tab_area = $('.tab-menu');
222  var $content = $('.contents .tab_cont-area');
223  var tab_active = 'select';
224  var content_show = 'is_show';
225  var id_arr = $content.map(function() { return '#' + $(this).attr('id');}).get();
226
227  var getHash = function() {
228    var hash = window.location.hash;
229    var index = id_arr.indexOf(hash);
230
231    if (index === -1) {
232      return false;
233    } else {
234      return id_arr[index];
235    }
236  };
237
238  var initialize = function() {
239    var hash = getHash();
240    if (hash) {
241      $tab_area.find('a[href="'+hash+'"]').addClass(tab_active);
242      $(hash).addClass(content_show);
243      $(window).on('load',function(){
244        setTimeout(function(){
245          var target = $(hash);
246          var position = target.offset().top;
247          $('body,html').animate({scrollTop:position}, 2000, 'swing');
248        },100);
249      });
250    } else {
251		// URLを取得
252		var url = location.href;
253		//URLチェック。パラメータが「?tab=〜」以外の場合はデータを渡さない
254		url = (url.match(/\?tab=\d+$/) || [])[0];
255		//console.log(url);
256
257		if(url) {
258			//console.log("urlがあったら");
259			//取得したURLを「?」で分割。変数paramsに格納
260			var params = url.split("?");
261			//さらにparams内、0から数えて1番目のデータを「=」で分割。変数tabに格納
262			var tab = params[1].split("=");
263			//tabに要素が存在するなら、変数tab内0から数えて1番目のデータを変数tabnameに格納
264			if($(tab).length){
265				var tabname = tab[1];
266				//console.log("tabname:" + tabname);
267			}else{
268				// 要素が存在しなければtabnameに1を代入する
269				var tabname = 1;
270				//console.log("tabname:" + tabname);
271			}
272			//コンテンツを一度すべて非表示にし、
273			$('.tab_cont-area').removeClass('is_show');
274			//一度タブについているクラスselectを消し、
275			$('.tab_btn').removeClass('select');
276
277			var tabno = $('.tab-menu #tab_btn' + tabname).index();
278			//console.log("tabno:" + tabno);
279			//クリックされたタブと同じ順番のコンテンツを表示します。
280			$('.tab_cont-area').eq(tabno).addClass('is_show');
281			//クリックされたタブのみにクラスselectをつけます。
282			$('.tab-menu .tab_btn').eq(tabno).addClass('select');
283		} else {
284			//console.log("urlがなかったら");
285			//$tab_area.find('li:first > a').addClass(tab_active);
286			//$($content[0]).addClass(content_show);
287		}
288    }
289  };
290  
291  $(function(){
292    $('.tab-menu li a').on('click', function(){
293      $('.tab-menu li').removeClass("current_page_item");
294      $(this).parent('li').addClass("current_page_item");
295    });
296  });
297
298  var addEvent = function() {
299    $tab_area.find('a').on('click', function() {
300      var href = $(this).attr('href');
301      var $targetContent = $(href);
302
303      if ($(this).hasClass(tab_active)) {
304        return false;
305      }
306
307      $tab_area.find('a').removeClass(tab_active);
308      $content.removeClass(content_show);
309
310      $(this).addClass(tab_active);
311      $targetContent.addClass(content_show);
312
313      return false;
314    });
315  };
316
317  return [initialize(), addEvent()];
318};
319custom_tab();
320
321// タブ付き固定ページのモーダル
322$(function(){
323  $(".custom-modal").modaal();
324  $('.custom-modal_close').click(function(){
325    $('.custom-modal').modaal('close');
326  });  
327  $('.video').modaal({
328    type: 'video'
329  });
330});
331
332/* ボタンをクリックした時 */
333$(function(){	
334	$('.tab_btn').on('click',function(){
335    var num = $(this).data('id'); // data-idを取得して変数numに格納
336    var tar = ".tab" + num; // ボタンに応じたモーダルのクラスを取得
337    $('.tab_cont-area').removeClass('is_show');
338    $(tar).addClass('is_show');
339    return false;
340  });
341
342//-----
343  //if(navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/)){
344  if(window.matchMedia('(min-width: 640px)').matches){
345    var parent = $('.has-child-item');
346    /*$(parent).on('click', function() {
347      var self = $(this);
348      parent.not(self).find('.list-item-acd').slideUp(200);
349      self.find('.list-item-acd').slideToggle(200);
350    })*/
351    $(".slideUp").on('click', function() {
352      console.log("!");
353      $(this).find('.list-item-acd').slideUp(200);
354    });
355  } else if(navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/)) {
356    var parent = $('.has-child-item');
357    $(parent).on('click', function() {
358      var self = $(this);
359      parent.not(self).find('.list-item-acd').slideUp(200);
360      self.find('.list-item-acd').slideToggle(200);
361    });
362    $(".slideUp").on('click', function() {
363      parent.find('.list-item-acd').slideUp(200);
364    });
365  } else {
366    var parent = $('.has-child-item');
367    $(parent).on('click', function() {
368      var self = $(this);
369      parent.not(self).find('.list-item-acd').slideUp(200);
370      self.find('.list-item-acd').slideToggle(200);
371    });
372  }
373});

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.