PageSourceSearch

https://www.nasu3800.co.jp/js/common.js

js nasu3800.co.jp collected 2026-10-03 21:29:12 UTC 5,726 bytes, 220 lines download raw bytes

1
2/* readyEvent
3------------------------------------------------------------------------*/
4
5$(function(){
6
7	if($('html').hasClass('ie')){
8        $('#footer .box_menu_footer .list_menu a').removeClass('over');
9    }
10
11	$('#header .con_nav').clone().addClass('con_fixnav').appendTo('#header').find('#gnav').attr('id', 'fixnav');
12
13
14	// smoothScroll ---------------------------//
15	var	speed = 1000,
16		easing = 'swing',
17		pcPosition = -60,
18		tabPosition = -50,
19		spPosition = $w.superResize({
20			//resize
21			resizeAfter : function(){
22				if(abi.sp) {
23					var navHeightSp = $('.con_fixnav').height();
24					spPosition = -navHeightSp;
25				}
26			}
27		});
28
29		$('a').not('.noscroll').click(function(){
30		var href = $(this).attr('href'),
31			case1 = href.charAt(0) == '#',
32			case2 = location.href.split('#')[0] == href.split('#')[0];
33
34		if(case1 || case2) {
35			if(case2)
36				href = '#'+href.split('#')[1];
37
38			$target = $(href);
39
40			if($target.length){
41				$html.add($body).not(':animated').animate({scrollTop : String($target.offset().top + (abi.pc ? pcPosition : abi.tab ? tabPosition : spPosition))},speed,easing);
42
43				return false;
44			}
45		}
46	});
47
48	// outerPageAnchorLink ---------------------------//
49	if(window.location.href.split('#')[1] == undefined || window.location.href.split('#')[1].indexOf('=') == -1) {
50		var $target = $('#'+window.location.href.split('#')[1]),
51			adjust = (abi.pc) ? pcPosition : (abi.tab) ? tabPosition : spPosition;
52
53		if($target.length) {
54			$w.load(function(){
55				var targetPosition = $target.offset().top;
56				$html.add($body).animate({scrollTop: String(targetPosition + adjust)}, 10);
57			});
58		}
59	}
60	// Lang dropdown
61	$('.bt_lang').on('mouseenter', function() {
62		$(this).find('ul').stop().slideDown();
63	});
64	$('.bt_lang').on('mouseleave', function() {
65		var _this = $(this);
66		setTimeout(function(){
67			_this.find('ul').stop().slideUp();
68		}, 200);
69	});
70	// Menu dropdown
71	$('#gnav .main_menu li.parent').click(function(){
72			$(this).stop().toggleClass("active");
73			$(this).find('.sub_menu').stop().toggleClass("active");
74	});
75
76	$('.open-popup-link').magnificPopup({
77		type:'inline',
78		midClick: false,
79		mainClass: 'mfp-with-zoom', // this class is for CSS animation below
80		  zoom: {
81		    enabled: true, // By default it's false, so don't forget to enable it
82
83		    duration: 300, // duration of the effect, in milliseconds
84		    easing: 'ease-in-out', // CSS transition easing function
85		    opener: function(openerElement) {
86		      return openerElement.is('.box_pop_content') ? openerElement : openerElement.find('.box_pop_content');
87		    }
88		  }
89
90	});
91
92	//tab
93	var $tab = $('.box_tabs_rec'),
94		$li = $tab.find('li');
95
96	$li.click(function(){
97		var target = $(this).attr('data-target');
98		if($(target).is(':hidden')) {
99			$(target).fadeIn(300).siblings().hide();
100			$(this).addClass('active').siblings().removeClass('active');
101		}
102	});
103
104	//menu accordion
105	    $('.accordion').click(function(){
106	        if(!$(this).is('.sp_only') || $(this).is('.sp_only') && abi.sp) {
107	            var $next = $(this).next();
108	            if(!$next.is(':animated')) $next.slideToggle(300).prev().toggleClass('active');
109	        }
110	    });
111
112	$('.open-popup-link').magnificPopup({
113		// delegate: 'a',
114		removalDelay: 500,
115		callbacks: {
116			beforeOpen: function() {
117				this.st.mainClass = this.st.el.attr('data-effect');
118			}
119		},
120		midClick: true
121	});
122
123	$w.on({
124		//load
125		'load' : function(){
126			$('.menuopen').click(function(){
127			  if($('body').hasClass('fix_active')) {
128			    $('body').removeClass('fix_active');
129			    $('.fixmenu').fadeOut();
130			    $('#fixnav-sp').stop().animate({'bottom' : '0'}, 500);
131				$html.css({
132					overflowY: '',
133					height: '',
134					margin:''
135				});
136			  } else {
137			    $('.fixmenu').fadeIn();
138			    $('body').addClass('fix_active');
139			    $('#fixnav-sp').stop().animate({'bottom' : '-100%'}, 500);
140				$html.css({
141					overflowY: 'hidden',
142					height: '100%',
143				});
144			  }
145			});
146		},
147		//scroll
148		'scroll' : function(){
149
150		}
151	}).firstLoad({
152		//firstLoad
153		pc_tab : function(){
154			var showFlug = false;
155				wH = $w.height();
156			    showFlug = false;
157			$(window).scroll(function () {
158				if ($(this).scrollTop() >= 60) {
159					if (showFlug == false) {
160						showFlug = true;
161						$('#obj_map').stop().fadeIn();
162						$('#header .con_nav').addClass('active');
163					}
164				} else {
165					if (showFlug) {
166						showFlug = false;
167						$hSearch = $("#search").height();
168						$('#header .con_nav').removeClass('active');
169						$('#obj_map').stop().fadeOut();
170					}
171				}
172			});
173		},
174		sp : function(){
175			//show btnTop, fixBtn
176			var showFlag = false;
177
178			$w.scroll(function () {
179			    if ($(this).scrollTop() >= $w.height()/2) {
180			        if (showFlag == false) {
181			            showFlag = true;
182						$('#header .con_nav').addClass('active');
183			        }
184			    } else {
185			        if (showFlag) {
186			            showFlag = false;
187						$('#header .con_nav').removeClass('active');
188			        }
189			    }
190			});
191
192		}
193	});
194	$(".overlay").show();
195    $.cookie('btnFlg') == 'on'?$(".overlay").hide():$(".overlay").show();
196    $(".btn_area .btn").click(function(){
197        $(".overlay").fadeOut();
198        var date = new Date();
199        date.setTime( date.getTime() + ( 10 * 60 * 1000 ));
200        $.cookie('btnFlg', 'on', { expires: date,path: '/' }); //cookieの保存
201    });
202});
203
204//matchHeight
205function matchHeight($o,m) {
206	$o.css('height','auto')
207	var foo_length = $o.length;
208
209	for(var i = 0 ; i < Math.ceil(foo_length / m) ; i++) {
210		var maxHeight = 0;
211		for(var j = 0; j < m; j++){
212			if ($o.eq(i * m + j).height() > maxHeight) {
213				maxHeight = $o.eq(i * m + j).height();
214			}
215		}
216		for(var k = 0; k < m; k++){
217			$o.eq(i * m + k).height(maxHeight);
218		}
219	}
220}

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.