PageSourceSearch

https://nttxstore.jp/js/usr/user_sb.js

js nttxstore.jp collected 2026-10-03 20:23:17 UTC 15,885 bytes, 378 lines download raw bytes

1var ecblib = ecblib || {};
2ecblib.customize = ecblib.customize || {};
3ecblib.customize.user_sb = ecblib.customize.user_sb || {};
4
5jQuery(function () {
6	var _user_sb = ecblib.customize.user_sb;
7
8	//-- トップページへ戻る初期値
9	jQuery('#footer_pagetop').hide();
10
11	//--- スムーススクロール
12	jQuery('a[href^="#"]').not('.js-noscroll').click(function () {
13		var speed = 500;
14		var headerH;
15		if (jQuery('#header').height() > 200) {
16			headerH = jQuery('#header').height() + 30;
17		} else {
18			headerH = jQuery('#header').height();
19		}
20		var href = jQuery(this).attr("href");
21		var target = jQuery(href == "#" || href == "" ? 'html' : href);
22		var position = target.offset().top - headerH;
23		jQuery('body,html').animate({ scrollTop: position }, speed, 'swing');
24		return false;
25	});
26	var scrollpos;
27	jQuery('#header_menu').click(function(){
28		jQuery("#search_view").fadeOut(200);
29		jQuery("#header_search").removeClass("active");
30		jQuery('#search_view').removeClass('current');
31		
32		if (jQuery(this).hasClass('active')){
33			jQuery('body').removeClass('body-fixed').css({'top': 0});
34			window.scrollTo(0,scrollpos);
35			jQuery("#menu_view").fadeOut(200);
36			jQuery(this).removeClass("active");
37			jQuery('#menu_view').removeClass('current');
38		} else {
39			scrollpos = jQuery(window).scrollTop();
40			jQuery('body').addClass('body-fixed').css({'top': -scrollpos});
41			jQuery("#menu_view").fadeIn(300);
42			jQuery(this).addClass("active");
43			jQuery('#menu_view').addClass('current');
44		}
45	});
46	jQuery('.js-menu-close').click(function(){
47		jQuery('body').removeClass('body-fixed').css({'top': 0});
48		window.scrollTo(0,scrollpos);
49		jQuery("#menu_view").fadeOut(200);
50		jQuery('#header_menu').removeClass("active");
51		jQuery('#menu_view').removeClass('current');
52	});
53	jQuery('.js-menu-nav').click(function(){
54		jQuery(this).toggleClass('open');
55		jQuery(this).next('ul').slideToggle();
56	});
57	jQuery('#header_search').click(function(){
58		jQuery("#menu_view").fadeOut(200);
59		jQuery("#header_menu").removeClass("active");
60		jQuery('#menu_view').removeClass('current');
61		
62		if (jQuery(this).hasClass('active')){
63			jQuery('body').removeClass('body-fixed').css({'top': 0});
64			window.scrollTo(0,scrollpos);
65			jQuery("#search_view").fadeOut(200);
66			jQuery(this).removeClass("active");
67			jQuery('#search_view').removeClass('current');
68		} else {
69			scrollpos = jQuery(window).scrollTop();
70			jQuery('body').addClass('body-fixed').css({'top': -scrollpos});
71			jQuery("#search_view").fadeIn(300);
72			jQuery(this).addClass("active");
73			jQuery('#search_view').addClass('current');
74		}
75	});
76	jQuery('#search_view .search_bg ,#search_view .block-header-search--close-button').click(function(){
77		jQuery('body').removeClass('body-fixed').css({'top': 0});
78		window.scrollTo(0,scrollpos);
79		jQuery("#search_view").fadeOut(200);
80		jQuery("#header_search").removeClass("active");
81		jQuery('#search_view').removeClass('current');
82	});
83	
84	jQuery('#brand_header_menu').click(function(){
85		jQuery("#search_view").fadeOut(200);
86		jQuery("#brand_header_search").removeClass("active");
87		jQuery('#search_view').removeClass('current');
88		
89		if (jQuery(this).hasClass('active')){
90			jQuery('body').removeClass('body-fixed').css({'top': 0});
91			window.scrollTo(0,scrollpos);
92			jQuery("#menu_view").fadeOut(200);
93			jQuery(this).removeClass("active");
94			jQuery('#menu_view').removeClass('current');
95		} else {
96			scrollpos = jQuery(window).scrollTop();
97			jQuery('body').addClass('body-fixed').css({'top': -scrollpos});
98			jQuery("#menu_view").fadeIn(300);
99			jQuery(this).addClass("active");
100			jQuery('#menu_view').addClass('current');
101		}
102	});
103	jQuery('#brand_header_search').click(function(){
104		jQuery("#menu_view").fadeOut(200);
105		jQuery("#brand_header_menu").removeClass("active");
106		jQuery('#menu_view').removeClass('current');
107		
108		if (jQuery(this).hasClass('active')){
109			jQuery('body').removeClass('body-fixed').css({'top': 0});
110			window.scrollTo(0,scrollpos);
111			jQuery("#search_view").fadeOut(200);
112			jQuery(this).removeClass("active");
113			jQuery('#search_view').removeClass('current');
114		} else {
115			scrollpos = jQuery(window).scrollTop();
116			jQuery('body').addClass('body-fixed').css({'top': -scrollpos});
117			jQuery("#search_view").fadeIn(300);
118			jQuery(this).addClass("active");
119			jQuery('#search_view').addClass('current');
120		}
121	});
122	jQuery('#search_view .search_bg ,#search_view .block-header-search--close-button').click(function(){
123		jQuery('body').removeClass('body-fixed').css({'top': 0});
124		window.scrollTo(0,scrollpos);
125		jQuery("#search_view").fadeOut(200);
126		jQuery("#brand_header_search").removeClass("active");
127		jQuery('#search_view').removeClass('current');
128	});
129
130	if (!(jQuery('.block-topic-path').length)) {
131		jQuery('.pane-footer').addClass('no-pan');
132	}
133	
134	// トピックをヘッダー下に追加
135    var $topicNotice = jQuery('#topic_notice');
136    if ($topicNotice.length === 0) return;
137
138    var $noticeUl = $topicNotice.find('ul.block-topic--items');
139    if ($noticeUl.length === 0) return;
140
141    // Ajaxでtopicdetaillist.aspx?category=0からトピックリストを取得
142    $.get(ecblib.sys.wwwroot + '/shop/topic/topicdetaillist.aspx?category=0', function (data) {
143        // 取得したHTMLからli要素を抽出
144        var $html = $('<div>').html(data);
145        var $items = $html.find('.block-topic--items li').slice(0, 3);
146
147        // コピーして#topic_notice内のulに追加
148        $items.each(function () {
149            $noticeUl.append($(this).clone());
150        });
151    });
152	/* 下層 ヘッダ下お知らせ 移動 */
153	if (jQuery('.block-header-information').length) {
154		jQuery('.block-header-information').prependTo('.pane-contents, .pane-order-contents');
155	}
156	
157	
158	/* スマホ版;ヘッダー→カテゴリ */
159	if (jQuery('.block-global-category--title').length) {
160		jQuery('.block-global-category--title + ul').prepend('<div class="block-global-category--close js-gnav-category-close"></div>');	
161	}
162	jQuery('.js-gnav-category').click(function(){
163		jQuery(this).next('ul').slideToggle();
164	});
165	jQuery(document).on('click', '.js-gnav-category-close', function() {
166		jQuery('.block-global-category ul').slideUp();
167	});
168
169	/**
170	 * ハンバーガーメニューを非表示にする
171	 */
172	_user_sb.hideHumbergerMenu = function () {
173		jQuery('#menu_view').fadeOut(200);
174		jQuery('#search_view').fadeOut(200);
175
176		document.querySelector('#menu_view')?.classList?.remove('current');
177		document.querySelector('#search_view')?.classList?.remove('current');
178		document.querySelector('#header_menu')?.classList?.remove('active');
179		document.querySelector('#header_search')?.classList?.remove('active');
180		document.querySelector('#brand_header_menu')?.classList?.remove('active');
181		document.querySelector('#brand_header_search')?.classList?.remove('active');
182		document.querySelector('body')?.classList?.remove('body-fixed');
183	};
184
185	if (ecblib.sys.isModeResponsiveView()) {
186		ecblib.sys.addMatchMediaEventListener(function (mediaQueryList) {
187			if (mediaQueryList.matches) {
188				ecblib.customize.user_sb.hideHumbergerMenu();
189			}
190		});
191	}
192		
193	if (jQuery('.block-topic-path').length) {
194		/* パンくず 移動&コピー */
195		const BREAKPOINT = 960;
196		let prevZone = null;
197
198		function getZone(width) {
199			return width < BREAKPOINT ? 'mobile' : 'pc';
200		}
201
202		function onResize() {
203			const wW = $(window).width();
204			const currentZone = getZone(wW);
205
206			if (prevZone !== currentZone) {
207				// ゾーンが切り替わった時だけ実行
208				if (currentZone === 'mobile') {
209					// 960px未満になった時の処理
210					//console.log('PC→モバイル');
211					if (jQuery('.block-topic-path.at-filter').length) {
212						jQuery('.block-topic-path.at-filter').addClass('js-move').prependTo('.pane-main');
213					} else {
214						jQuery('.block-topic-path.js-copy').remove();
215						//jQuery('.block-topic-path').addClass('js-move').prependTo('.pane-main');
216					}
217				} else {
218					// 960px以上になった時の処理
219					//console.log('モバイル→PC');
220					if (jQuery('.block-topic-path.at-filter').length) {
221						jQuery('.block-topic-path.at-filter').addClass('js-move').prependTo('.pane-main');
222						//jQuery('.block-topic-path.at-filter').clone().addClass('js-copy').appendTo('.pane-main');
223					} else if (jQuery('.page-goods').length) {
224						jQuery('.block-topic-path').clone().addClass('js-copy').appendTo('.pane-main');
225					} else if (jQuery('.block-mypage-footermenu, .block-withdrawal, .page-guestbookmark').length) {
226						jQuery('.block-topic-path').appendTo('.pane-main');
227						jQuery('.block-topic-path').clone().addClass('js-copy').prependTo('.pane-main');
228					} else {
229						jQuery('.block-topic-path').clone().addClass('js-copy').prependTo('.pane-main');
230					}
231				}
232			}
233			prevZone = currentZone;
234		}
235
236		$(document).ready(onResize);
237		$(window).on('resize', onResize);
238	}	
239		
240
241	//商品一覧のスタイル調整
242	const setScrollbarWidthProperty = function () {
243		let bodyScrollWidth = window.innerWidth - document.body.clientWidth;
244		document.documentElement.style.setProperty('--usr-scrollbar-width', `${bodyScrollWidth}px`);
245		//document.documentElement.style.setProperty('--usr-scrollbar-width', + bodyScrollWidth + 'px');
246	};
247
248	setScrollbarWidthProperty();
249	window.addEventListener('resize', setScrollbarWidthProperty);
250	
251	jQuery('.js-style-items, .js-sort-items').wrapAll('<div class="block-goods-list--params"><div class="block-goods-list--params--inner"></div></div>');
252	jQuery('.js-style-items select').each(function() {
253		jQuery(this).after('<ul class="block-style--list"></ul>');
254		jQuery(this).find('option').each(function() {
255			if(jQuery(this).val() != '') {
256				jQuery('.js-style-items ul.block-style--list').append('<li class="block-style--list-item"><a href="' + jQuery(this).val() + '">' + jQuery(this).text() + '</a></li>');
257			} else {
258				jQuery('.js-style-items ul.block-style--list').append('<li class="block-style--list-item"><span class="checked">' + jQuery(this).text() + '</span></li>');
259			}
260		});
261	});
262	jQuery('.js-style-items .block-style--element').after('<div class="block-style--element-bg"></div>');
263	jQuery('body').on('click', '.js-style-items h2', function() {
264		jQuery(this).closest('.js-style-items').find('.block-style--element, .block-style--element-bg').addClass('is-show');
265	});
266	jQuery('body').on('click', '.js-style-items .block-style--element-bg', function() {
267		jQuery(this).closest('.js-style-items').find('.block-style--element').removeClass('is-show');
268		jQuery(this).removeClass('is-show');
269	});
270	jQuery('.js-sort-items select').each(function() {
271		jQuery(this).after('<ul class="block-sort--list"></ul>');
272		jQuery(this).find('option').each(function() {
273			if(jQuery(this).val() != '') {
274				jQuery('.js-sort-items ul.block-sort--list').append('<li class="block-sort--list-item"><a href="' + jQuery(this).val() + '">' + jQuery(this).text() + '</a></li>');
275			} else {
276				jQuery('.js-sort-items ul.block-sort--list').append('<li class="block-sort--list-item"><span class="checked">' + jQuery(this).text() + '</span></li>');
277			}
278		});
279	});
280	jQuery('.js-sort-items .block-sort--element').after('<div class="block-sort--element-bg"></div>');
281	jQuery('body').on('click', '.js-sort-items h2', function() {
282		jQuery(this).closest('.js-sort-items').find('.block-sort--element, .block-sort--element-bg').addClass('is-show');
283	});
284	jQuery('body').on('click', '.js-sort-items .block-sort--element-bg', function() {
285		jQuery(this).closest('.js-sort-items').find('.block-sort--element').removeClass('is-show');
286		jQuery(this).removeClass('is-show');
287	});
288	jQuery('body').on('click', '#frmFilterList .block-filter--clear-btn', function() {
289		let $parent_filter_frame = jQuery(this).closest('#frmFilterList');
290		$parent_filter_frame.find('input[type="checkbox"]').prop('checked', false);
291		$parent_filter_frame.find('input[type="checkbox"]').trigger('change');
292		$parent_filter_frame.find('select').val('');
293		$parent_filter_frame.find('input[name^="filtercode"][type="hidden"]').remove();
294		$parent_filter_frame.find('.block-filter--treeitem-selected').removeClass('block-filter--treeitem-selected');
295		return false;
296	});
297
298	jQuery('body').on('change', '.block-filter--option-items label.checkbox input[type=checkbox]', function() {
299		if(jQuery(this).prop('checked')){
300			jQuery(this).closest('label.checkbox').addClass('checked');
301		} else {
302			jQuery(this).closest('label.checkbox').removeClass('checked');
303		}
304	});
305	jQuery('.block-filter--option-items label.checkbox input[type=checkbox]').trigger('change');
306		
307	if (jQuery('.block-goods-list--params').length) {
308		let wW = jQuery(window).width();
309		if (wW < 960) {
310			jQuery('.block-goods-list-naviframe--top-nav').insertBefore('.block-goods-list--params');
311		} else {
312			//jQuery('.block-goods-list--params').prependTo('.block-event-page--goods');
313			jQuery('.block-goods-list--params--inner').append('<div class="block-goods-list--params--left"></div><div class="block-goods-list--params--right"></div>');
314			jQuery('.block-goods-list-naviframe--top-nav').appendTo('.block-goods-list--params--left');
315			jQuery('.block-goods-list--display-style-items, .block-goods-list--sort-order-items').appendTo('.block-goods-list--params--right');
316		}
317	}
318	if (jQuery('#block_of_filter').length) {
319			jQuery('#block_of_filter').parent('div').addClass('is-filter');
320	}
321	if (jQuery('.block-goosearch-goods-list').length) {
322			jQuery('.block-goosearch-goods-list').addClass('is-filter');
323			if (!(jQuery('.block-goods-list--params').length)) {
324				jQuery('.block-filter').css('margin-top', '32px');
325			}
326	}
327});
328		
329
330		
331jQuery(window).on('scroll resize', function () {
332	var _user_sb = ecblib.customize.user_sb;
333
334	var scrollHeight = jQuery(document).height();
335	var scrollPosition = jQuery(window).height() + jQuery(window).scrollTop();
336	var footHeight = jQuery('footer').height();
337
338	if (jQuery(this).scrollTop() > 120) {
339		jQuery('#footer_pagetop').show();
340	} else if (jQuery(this).scrollTop() < 80) {
341		jQuery('#footer_pagetop').hide();
342	}
343
344	if (scrollHeight - scrollPosition <= footHeight) {
345		jQuery('#footer_pagetop').css({ 'opacity': '0.2' });
346	} else {
347		jQuery('#footer_pagetop').css({ 'opacity': '1' });
348	}
349
350	if (jQuery(this).scrollTop() > 30) {
351		jQuery('#header').addClass('js-fixed');
352
353	} else {
354		jQuery('#header').removeClass('js-fixed');
355		let headerHeight = jQuery('#header').height();
356		jQuery('.pane-contents').css('padding-top', headerHeight + 'px');
357		jQuery('.pane-order-contents').css('padding-top', headerHeight + 'px');
358	}
359
360});
361
362$(window).on('load resize', function(){
363	setTimeout(function(){
364		let headerHeight = jQuery('#header').height();
365		jQuery('.pane-contents').css('padding-top', headerHeight + 'px');
366		jQuery('.pane-order-contents').css('padding-top', headerHeight + 'px');
367	},500);
368});
369
370
371window.lazySizesConfig = window.lazySizesConfig || {};
372/* lazysizesの設定の変更はここから記述してください
373  ・lazySizesConfig.expandは、大きな画像を早めに読み込み開å
373§‹ã•せたい場合などに使用してください
374    正の値を指定すると読み込み開始スクロール位置が上に(早く)なります
375    負の値を設定すると読み込み開始スクロール位置が下に(遅く)なります
376    ※lazySizesConfig.expandを指定しない場合、画像の読み込み状況やブラウザのアイドリング状況に応じて動的に最適化されますが
377      指定すると動的な最適化が無効になることに注意してください
378*/

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.