PageSourceSearch

https://www.tokiwa-dept.co.jp/js/common.js

js tokiwa-dept.co.jp collected 2026-09-29 20:50:15 UTC 13,479 bytes, 445 lines download raw bytes

1//viewport書き換え
2$(function(){
3    // setViewport
4    spView = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes';
5		//tbView = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes';
6    tbView = 'width=1280,maximum-scale=1,user-scalable=0';
7
8    if(navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPod') > 0 || (navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') > 0)){
9        $("meta[name='viewport']").attr('content',spView);
10    } else if(navigator.userAgent.indexOf('iPad') > 0 || (navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') == -1) || navigator.userAgent.indexOf('A1_07') > 0 || navigator.userAgent.indexOf('SC-01C') > 0){
11        $("meta[name='viewport']").attr('content',tbView);
12    }
13});
14
15
16//ヘッダー追従
17$(function(){
18	var wid = $(window).width();
19	if( wid < 480 ){
20
21	}else{
22
23				//店舗メニュー
24				$(function() {
25						var nav = $('.global-nav');
26            if($('.global-nav').size() != 0){
27              //表示位置
28  						var navTop    = nav.offset().top+300;
29  						var navHeight = nav.height();
30  						var showFlag  = false;
31  						nav.css('top', -navHeight+'px');
32  						//ナビゲーションの位置まできたら表示
33  						$(window).scroll(function () {
34  								var winTop = $(this).scrollTop();
35  								if (winTop >= navTop) {
36  										if (showFlag == false) {
37  												showFlag = true;
38  												nav
39  														.addClass('fixed')
40  														.stop().animate({'top' : '0px'}, 200);
41  										}
42  								} else if (winTop <= navTop) {
43  										if (showFlag) {
44  												showFlag = false;
45  												nav.stop().animate({'top' : -navHeight+'px'}, 200, function(){
46  														nav.removeClass('fixed');
47  												});
48  										}
49  								}
50  						});
51            }
52				});
53
54				//ポータルメニュー
55				$(function() {
56					$(window).on('scroll', function() {
57						if ($(this).scrollTop() > 1) {
58							$('#header-portal').addClass('fixed');
59						}
60						if ($(this).scrollTop() > 100) {
61							$('#header-portal.top').removeClass('top');
62						}
63						 else {
64							$('#header-portal').removeClass('fixed');
65							$('#header-portal').addClass('top');
66							//$('#header-portal').css('background-color','none');
67						}
68					});
69				});
70
71			}
72});
73
74$(function(){
75var menu = $('.all-menu-wrap'), // スライドインするメニューを指定
76    menuBtn = $('#spmenu'), // メニューボタンを指定
77    body = $(document.body),
78    menuWidth = menu.outerWidth();
79
80    // メニューボタンをクリックした時の動き
81    menuBtn.on('click', function(){
82    // body に open クラスを付与する
83		menuBtn.toggleClass("active");
84    body.toggleClass('open');
85        if(body.hasClass('open')){
86            // open クラスが body についていたらメニューをスライドインする
87            body.animate({'right' : menuWidth }, 300);
88            menu.animate({'right' : 0 }, 300);
89						menuBtn.css({'right':'240px'});
90        } else {
91            // open クラスが body についていなかったらスライドアウトする
92            menu.animate({'right' : -menuWidth }, 300);
93            body.animate({'right' : 0 }, 300);
94						menuBtn.css({'right': 0 });
95        }
96    });
97});
98
99//タブ切替
100//$(document).ready(function() {
101//    //最初に表示するコンテンツ
102//    $('.tab-contents:first').show();
103//    //class="select"を追加
104//    $('#tab-shop-category li:first,#tab-floor-nav li:first, #tab-list-menu li:first').addClass('select');
105//
106//    //クリックイベント
107//    $('#tab-shop-category li,#tab-floor-nav li, #tab-list-menu li').click(function() {
108//        $('#tab-shop-category li,#tab-floor-nav li, #tab-list-menu li').removeClass('select');
109//        $(this).addClass('select');
110//        $('.tab-contents').hide();
111//        $($(this).find('a').attr('href')).fadeIn();
112//        return false;
113//    });
114//});
115$(document).ready(function() {
116    //最初に表示するコンテンツ
117    $('.tab-contents:first').show();
118    //class="select"を追加
119    $('#tab-shop-category li:first, #tab-list-menu li:first').addClass('select');
120
121    //クリックイベント
122    $('#tab-shop-category li, #tab-list-menu li').click(function() {
123        $('#tab-shop-category li, #tab-list-menu li').removeClass('select');
124        $(this).addClass('select');
125        $('.tab-contents').hide();
126        $($(this).find('a').attr('href')).fadeIn();
127        return false;
128    });
129});
130
131//共通ブランドサーチ
132$(function(){
133
134	$('.bland-search').click(function(){
135		wn = '.' + $(this).data('tgt');
136
137		/*var mW = $(wn).find('.search-contents').innerWidth() / 2;
138		var mH = $(wn).find('.search-contents').innerHeight() / 2;
139		$(wn).find('.calendar-inner').css({'margin-left':-mW,'margin-top':-mH});*/
140		$(wn).fadeIn(500);
141	});
142	$('.close,.search-overlay').click(function(){
143		$(wn).fadeOut(500);
144	});
145});
146
147//サービスガイド
148$(function(){
149	$(".serviceguide-list dd:not(:first)").css("display","none");
150	$(".serviceguide-list dt:first").addClass("select");
151  $(".serviceguide-list dt, .serviceguide-list dt span").on("click", function() {
152    $(this).next().slideToggle();
153		$(this).toggleClass("select");
154  });
155});
156
157
158//スマホ時のみTELテキストで有効
159$(function(){
160    var ua = navigator.userAgent;
161    if(ua.indexOf('iPhone') > 0 || ua.indexOf('Android') > 0){
162        $('.tel-link-txt').each(function(){
163            var str = $(this).text();
164            $(this).html($('<a>').attr('href', 'tel:' + str.replace(/-/g, '')).append(str + '</a>'));
165        });
166    }
167});
168
169
170$(function(){
171var menu = $('.gnav'), // スライドインするメニューを指定
172    menuBtn = $('#menu-button'), // メニューボタンを指定
173    body = $(document.body),
174    menuWidth = menu.outerWidth();
175
176    // メニューボタンをクリックした時の動き
177    menuBtn.on('click', function(){
178    // body に open クラスを付与する
179		menuBtn.toggleClass("active");
180    body.toggleClass('open');
181        if(body.hasClass('open')){
182            // open クラスが body についていたらメニューをスライドインする
183            body.animate({'right' : menuWidth }, 300);
184            menu.animate({'right' : 0 }, 300);
185        } else {
186            // open クラスが body についていなかったらスライドアウトする
187            menu.animate({'right' : -menuWidth }, 300);
188            body.animate({'right' : 0 }, 300);
189        }
190    });
191});
192
193/* ページトップ
194$(function() {
195	var topBtn = $('.page-top');
196	topBtn.hide();
197	$(window).scroll(function () {
198		if ($(this).scrollTop() > 100) {
199			topBtn.fadeIn();
200		} else {
201			topBtn.fadeOut();
202		}
203	});
204    topBtn.click(function () {
205		$('body,html').animate({
206			scrollTop: 0
207		}, 500);
208		return false;
209    });
210});*/
211
212$(function(){
213	var wid = $(window).width();
214	if( wid < 480 ) {
215
216      // 各館TOP
217			$(function(){
218        $('.main-slider ul').slick({
219          slidesToShow   : 1,
220          slidesToScroll : 1,
221          autoplay       : true,
222          speed          : 400,
223          autoplaySpeed  : 5000,
224          pauseOnHover   : false,
225          pauseOnFocus   : false,
226        });
227			});
228
229      // 各館イベントニュース
230			$(function(){
231				$('#event-slider').sliderPro({
232					width           : 136,			//横幅
233					height          : 136,
234					arrows          : true,			//左右の矢印
235					buttons         : true,			//ナビゲーションボタンを出す
236					slideDistance   : 2,				//スライド同士の距離
237					visibleSize     : '100%',		//前後のスライドを表示
238					autoplay        : true,
239        	loop            : true,
240					autoplayOnHover : 'none'
241				});
242
243			});
244
245      // トキフォト
246			$(function(){
247        $('.collection-slider ul').slick({
248          slidesToShow   : 3,
249          slidesToScroll : 1,
250          autoplay       : true,
251          speed          : 400,
252          autoplaySpeed  : 5000,
253          pauseOnHover   : false,
254          pauseOnFocus   : false,
255        });
256			});
257
258      // ポータルTOP・イベントニュース
259			$(function(){
260        $('.portal-event-slider').slick({
261          slidesToShow   : 1,
262          slidesToScroll : 1,
263          autoplay       : true,
264          speed          : 400,
265          autoplaySpeed  : 5000,
266          pauseOnHover   : false,
267          pauseOnFocus   : false,
268        });
269			});
270
271      // わさだシネマ
272			$(function(){
273        $('.cinema-slider ul').slick({
274          slidesToShow   : 1,
275          slidesToScroll : 1,
276          autoplay       : true,
277          speed          : 400,
278          autoplaySpeed  : 5000,
279          pauseOnHover   : false,
280          pauseOnFocus   : false,
281        });
282			});
283
284	}
285  else {
286      // 各館TOP
287			$(function(){
288        $('.main-slider ul').slick({
289          slidesToShow   : 3,
290          slidesToScroll : 1,
291          infinite       : true,
292          initialSlide   : -1,
293          autoplay       : true,
294          speed          : 400,
295          autoplaySpeed  : 5000,
296          pauseOnHover   : false,
297          pauseOnFocus   : false,
298        });
299			});
300
301      // 各館イベントニュース
302			$(function(){
303        if($('#event-slider .sp-slide').length){
304          $('#event-slider').sliderPro({
305  					width           : 272,			//横幅
306  					height          : 272,
307  					arrows          : true,			//左右の矢印
308  					buttons         : true,			//ナビゲーションボタンを出す
309  					slideDistance   : 4,				//スライド同士の距離
310  					visibleSize     : '100%',		//前後のスライドを表示
311  					autoplay        : true,
312          	loop            : true,
313  					autoplayOnHover : 'none'
314  				});
315        }
316			});
317
318      // トキフォト
319			$(function(){
320        $('.collection-slider ul').slick({
321          slidesToShow   : 5,
322          slidesToScroll : 1,
323          autoplay       : true,
324          speed          : 400,
325          autoplaySpeed  : 5000,
326          pauseOnHover   : false,
327          pauseOnFocus   : false,
328        });
329			});
330
331      // わさだシネマ
332			$(function(){
333        $('.cinema-slider ul').slick({
334          slidesToShow   : 5,
335          slidesToScroll : 1,
336          autoplay       : true,
337          speed          : 400,
338          autoplaySpeed  : 5000,
339          pauseOnHover   : false,
340          pauseOnFocus   : false,
341        });
342			});
343
344      // ポータルTOP・イベントニュース
345			$(function(){
346        $('.portal-event-slider').slick({
347          slidesToShow   : 4,
348          slidesToScroll : 1,
349          autoplay       : true,
350          speed          : 400,
351          autoplaySpeed  : 5000,
352          pauseOnHover   : false,
353          pauseOnFocus   : false,
354        });
355			});
356
357	}
358});
359
360// ポータルTOP・メインスライダー
361$('.portal-stance-slider').slick({
362  dots           : true,
363  slidesToShow   : 1,
364  slidesToScroll : 1,
365  autoplay       : true,
366  speed          : 400,
367  autoplaySpeed  : 5000,
368  pauseOnHover   : false,
369  pauseOnFocus   : false,
370});
371
372
373//コレクション部分
374//$(function(){
375//
376//	$('.calendar-btn').click(function(){
377//		wn = '.' + $(this).data('tgt');
378//
379//		var mW = $(wn).find('.calendar-inner').innerWidth() / 2;
380//		var mH = $(wn).find('.calendar-inner').innerHeight() / 2;
381//		$(wn).find('.calendar-inner').css({'margin-left':-mW,'margin-top':-mH});
382//		$(wn).fadeIn(500);
383//	});
384//	$('.close,.modal-overlay').click(function(){
385//		$(wn).fadeOut(500);
386//	});
387//});
388
389
390//イベントカレンダー
391var scrollpos;
392$(function(){
393	$(document).on('click tap', '.calendar-btn', function(){
394		wn = '.' + $(this).data('tgt');
395		var mW = $(wn).find('.calendar-inner').innerWidth() / 2;
396		var mH = $(wn).find('.calendar-inner').innerHeight() / 2;
397		$(wn).find('.calendar-inner').css({'margin-left':-mW,'margin-top':-mH});
398		$(wn).fadeIn(500);
399	});
400	$(document).on('click tap', '.close,.modal-overlay', function(){
401    $(this).parents('.calendar-contents').fadeOut(500);
402		//$(wn).fadeOut(500);
403	});
404});
405
406
407//ショップ詳細ショップアイテム画像
408$(function(){
409	$(document).on('click tap', '.modal-btn', function(){
410		wn = '.' + $(this).data('tgt');
411
412		var mW = $(wn).find('.modal-inner').innerWidth() / 2;
413		var mH = $(wn).find('.modal-inner').innerHeight() / 2;
414		$(wn).find('.modal-inner').css({'margin-left':-mW,'margin-top':-mH});
415		$(wn).fadeIn(500);
416	});
417	$(document).on('click tap', '.close,.modal-overlay', function(){
418    $(this).parents('.modal-contents').fadeOut(500);
419		//$(wn).fadeOut(500);
420	});
421});
422
423
424//PC版のみ - 営業時間メニュー開閉
425$(function() {
426  // クリックすると発動
427  $('#side-time-arrow').click(function() {
428    // 要素にclassの追加 or 削除
429    $('.side-time-box').toggleClass('open'), 
430    $('#side-time-arrow').toggleClass('open');
431  }); 
432
433});
434
435
436//SP版のみ - 営業時間もっと見る
437$(function(){
438  $('.side-time-cont:not(.side-time-cont:first-of-type)').css('display','none');//一番上の要素以外を非表示
439  $('.side-time-more').nextAll('.side-time-more').css('display','none');//ボタンを非表示
440  $('.side-time-more').on('click', function() {
441    $(this).css('display','none');//押したボタンを非表示
442    $(this).next('.side-time-cont').slideDown('fast');
443    $(this).nextAll('.side-time-more:first').css('display','block'); //次のボタンを表示
444  });
445});

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.