PageSourceSearch

https://www.bourou-hakodate.com/noguchi-cms/wp-content/themes/vanilla/js/scripts.js

js bourou-hakodate.com collected 2026-09-30 18:27:35 UTC 5,161 bytes, 247 lines download raw bytes

1var app = app || {};
2
3app.init = function () {
4
5	app.slider();
6	app.thumbnail();
7	app.anchorAnimate();
8	app.backTop();
9	app.navCollapse();
10	app.tabs();
11
12	$(window).on('load resize', function(){
13		app.equalHeight('.list-tourism .item');
14	});
15
16}
17
18app.tabs = function() {
19	$('.tabs').each(function(){
20		var $active, $content, $links = $(this).find('a');
21		$active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]);
22		$active.addClass('active');
23		$content = $($active.attr('href'));
24		$links.not($active).each(function () {
25			$($(this).attr('href')).hide();
26		});
27		$(this).on('click', 'a', function(e){
28		$active.removeClass('active');
29		$content.hide();
30		$active = $(this);
31		$content = $($(this).attr('href'));
32		$active.addClass('active');
33		$content.show();
34		e.preventDefault();
35		});
36	});
37}
38
39app.slider = function () {
40
41	$(window).on('load',function(){
42
43		if( $('.bx-top-slider').length ) {
44			$('.bx-top-slider').bxSlider({
45				mode: 'fade',
46				auto: true,
47				speed: 1000,
48				pause: 3000,
49				controls: false,
50				pager: true
51			});
52		}
53
54		if( $('.bx-ga-adv').length ) {
55
56			if( $(window).width() > 481 ) {
57				var bx_ga_adv = $('.bx-ga-adv').bxSlider({
58					auto: true,
59					speed: 1000,
60					pause: 3500,
61					controls: true,
62					pager: false,
63					slideWidth: 296,
64				    minSlides: 3,
65				    maxSlides: 5,
66				    slideMargin: 3,
67				    moveSlides: 1
68				});
69			}
70			else {
71				var bx_ga_adv = $('.bx-ga-adv').bxSlider({
72					auto: true,
73					speed: 1000,
74					pause: 3500,
75					controls: true,
76					pager: false,
77					maxSlides:1,
78					slideMargin:0
79				});
80			}
81
82
83
84			$(window).on('resize',function(e){
85				e.preventDefault();
86				if( $(window).width() > 481 ) {
87					bx_ga_adv.reloadSlider({
88						auto: true,
89						speed: 1000,
90						pause: 3500,
91						controls: true,
92						pager: false,
93						slideWidth: 296,
94					    minSlides: 2,
95					    maxSlides: 3,
96					    slideMargin: 3,
97					    moveSlides: 1
98					});
99				}
100				else {
101					bx_ga_adv.reloadSlider({
102						auto: true,
103						speed: 1000,
104						pause: 3500,
105						controls: true,
106						pager: false,
107						maxSlides:1,
108					slideMargin:0
109					});
110				}
111			});
112
113		}
114
115		if( $('.bx-top-story').length ) {
116
117			if( $(window).width() > 481 ) {
118				var bx_top_story = $('.bx-top-story').bxSlider({
119					auto: true,
120					speed: 1000,
121					pause: 3000,
122					controls: true,
123					pager: false,
124					slideWidth: 500,
125				    minSlides: 2,
126				    maxSlides: 2,
127				    slideMargin: 0,
128				    moveSlides: 1
129				});
130			}
131			else {
132				var bx_top_story = $('.bx-top-story').bxSlider({
133					auto: true,
134					speed: 1000,
135					pause: 3000,
136					controls: true,
137					pager: false,
138					maxSlides:1,
139					slideMargin:0
140				});
141			}
142
143			$(window).on('resize',function(e){
144				e.preventDefault();
145				if( $(window).width() > 481 ) {
146					bx_top_story.reloadSlider({
147						auto: true,
148						speed: 1000,
149						pause: 3000,
150						controls: true,
151						pager: false,
152						slideWidth: 500,
153					    minSlides: 2,
154					    maxSlides: 2,
155					    slideMargin: 0,
156					    moveSlides: 1
157					});
158				}
159				else {
160					bx_top_story.reloadSlider({
161						auto: true,
162						speed: 1000,
163						pause: 3000,
164						controls: true,
165						pager: false
166					});
167				}
168			});
169
170		}
171
172	});
173}
174
175app.navCollapse = function() {
176	$(".btn-menu").click(function() {
177		$(".popup-menu").fadeIn(300);
178		$("body").addClass("ovh");
179	});
180	$(".popup-menu .popup-close").click(function() {
181		$(".popup-menu").fadeOut(300);
182		$("body").removeClass("ovh");
183	});
184}
185
186app.thumbnail = function() {
187	$(".list-thumbnails li a, .thumb-click li a").click(function() {
188		$('.list-thumbnails li, .thumb-click li').removeClass("current");
189		$(this).parent().addClass("current");
190		var src = $(this).find('img').attr('src');
191		$('.large img').attr('src', src);
192		return false;
193	});
194}
195
196app.anchorAnimate = function() {
197    var speed = 500;
198	$('.anchor a').click(function() {
199		var href= $(this).attr("href");
200		var target = $(href == "#" || href == "" ? 'html' : href);
201		var position = target.offset().top;
202		$('body,html').animate({scrollTop:position - $("header").outerHeight()}, speed, 'swing');
203		return false;
204	 });
205}
206
207app.backTop = function() {
208	$('.back-top').click(function() {
209		$('html, body').animate({scrollTop:0},500);
210	});
211}
212
213app.equalHeight = function(container){
214	var currentTallest = 0,
215		currentRowStart = 0,
216	    rowDivs = new Array(),
217	    $el,
218	    topPosition = 0;
219	$(container).each(function() {
220	   	$el = $(this);
221	   	$($el).height('auto');
222	   	topPostion = $el.position().top;
223
224	   	if (currentRowStart != topPostion) {
225	   		for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
226	   			rowDivs[currentDiv].height(currentTallest);
227	   		}
228	   		rowDivs.length = 0; // empty the array
229	   		currentRowStart = topPostion;
230	   		currentTallest = $el.height();
231	   		rowDivs.push($el);
232	   	} else {
233	   		rowDivs.push($el);
234	   		currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
235	   	}
236	   	for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
237	   		rowDivs[currentDiv].height(currentTallest);
238	   	}
239	});
240}
241
242
243$(function() {
244
245	app.init();
246
247});

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.