PageSourceSearch

https://mrs.living.jp/wp-content/themes/mrs/pc/area/common/js/contents.js

js living.jp collected 2026-10-01 11:48:22 UTC 10,394 bytes, 343 lines download raw bytes

1jQuery(document).ready(function($){
2	//要素の高さを揃える
3	$(".present-now ul li").tile();
4	//$(".recommend-area ul li").tile();
5	$(".column-blog-area ul li dl dd dl dd.title").tile();
6	$(".column-blog-area ul.blog-area li").tile();
7	$(".new-area ul.thum-box li").tile();
8	$(".new-area ul.thum-box li dl dd .text").tile();
9	$(".info-box ul li.bdr").tile();
10	$(".present-area .main-area .inner").tile();
11	$(".present-campaig ul li").tile();
12	$(".three-column li .name").tile();
13	$(".blogger-area .three-column li .name").tile();
14	$(".four-column li .title").tile();
15	$(".attntion-area ul li").tile();
16	$(".new-report li").tile();
17
18	domain_judge = location.host.indexOf('.local');
19
20	if (domain_judge === -1) {
21		$('#single a[href*=#]').each(function(){
22			href = $(this).prop("href");
23			if (href.indexOf('mrs') != -1) {
24				if (href.indexOf('stg') != -1 || href.indexOf('living') != -1) {
25					if ( ~href.indexOf('http:') ) {
26						href = href.replace("http", "https");
27						$(this).attr("href", href);
28					}
29				}
30			}
31		});
32	}
33
34	//スクロール
35	$('a[href*=#]').click(function() {
36
37		// hrefの先頭文字が「#」かどうかを取得
38        anchorCheck = $(this).attr("href").slice( 0, 1 ),
39
40        // リビングは記事本文が強制で絶対パスになるので、「#」以降を取得して再度「#」を付ける
41        href = $(this).prop("href"),
42        hrefPageUrl = href.split("#")[0],
43        currentUrl = location.href,
44        currentUrl = currentUrl.split("#")[0];
45
46        //#より前の絶対パスが、リンク先と現在のページで同じ、または「href」の先頭文字が「#」なら、スムーススクロールを実行
47        if(hrefPageUrl == currentUrl || anchorCheck == '#'){
48            href = href.split("#"),
49            href = href.pop(),
50            href = "#" + href;
51
52            var target = $(href == "#" || href == "" ? 'html' : href);
53            var headerHeight = 220;
54            position = (hrefPageUrl == currentUrl) ? target.offset().top - headerHeight : target.offset().top;
55			$('html,body').animate({ scrollTop: position }, 'slow','swing');
56            return false;
57        }
58    });
59
60    var url = $(location).attr("href");
61	if (url.indexOf('comment-') != -1) {
62		var anchor = url.split("#");
63		var headerHeight = 220;
64		target = $('#' + anchor[anchor.length - 1]);
65		position = Math.floor(target.offset().top) - headerHeight;
66		$("html, body").animate({scrollTop:position}, 500);
67	}
68    
69    //fancybox
70	var fancyWidth = 950;
71	var fancyHeight = 640;
72	var userAgent = window.navigator.userAgent.toLowerCase();
73	var num = 100;
74	if(userAgent.indexOf('firefox') != -1) {
75		var num = 0;
76	}
77	$("#various1").fancybox({
78		'titlePosition'		: 'inside',
79		'transitionIn'		: 'none',
80		'transitionOut'		: 'none',
81		'autoDimensions'	: false,
82		'overlayColor'		: '#000',
83		'width'				: 564,
84		'height'            : 'auto',
85		'autoScale'         : false,
86		'scrolling':'none',
87	});
88	$(".region_select").fancybox({
89		'titlePosition'		: 'inside',
90		'transitionIn'		: 'none',
91		'transitionOut'		: 'none',
92		'autoDimensions'	: false,
93		'overlayColor'		: '#000',
94		'width'				: fancyWidth,
95		'height'            : fancyHeight - num,
96		'autoScale'         : false,
97		'scrolling':'none'
98	});
99	$(".region_select2").fancybox({
100		'titlePosition'		: 'inside',
101		'transitionIn'		: 'none',
102		'transitionOut'		: 'none',
103		'autoDimensions'	: false,
104		'overlayColor'		: '#000',
105		'width'				: fancyWidth,
106		'height'            : fancyHeight,
107		'autoScale'         : false,
108		'scrolling':'none'
109	});
110	$(".search__narrow").addClass('fancybox_set').attr("href","#modal-search");
111	$(".modal_menu_btn, .fancybox_set").fancybox({
112		titlePosition		: 'inside',
113		transitionIn		: 'none',
114		transitionOut		: 'none',
115		autoDimensions		: false,
116		overlayColor		: '#000',
117		width				: 585,
118		height            	: 700,
119		autoScale         	: false,
120		padding 			: 0,
121		scrolling 			: 'auto'
122	});
123	$(".modal_menu_btn, .search__narrow").click(function(e){ 
124		scrollPosition = $(window).scrollTop();
125		$('body').addClass('fixed').css({'top': -scrollPosition});
126		$("#fancybox-outer").addClass('add_design');
127		$("#fancybox-close").addClass('cross');
128	});
129	$(document).on("click", "#fancybox-close, #fancybox-overlay", function(){
130		$('body').removeClass('fixed').css({'top': 0});
131		window.scrollTo( 0 , scrollPosition );
132		$("#fancybox-outer").removeClass('add_design');
133		$("#fancybox-close").removeClass('cross');
134	});
135	$("#inline1 .fancybox a,#inline2 .fancybox a,#inline3 .fancybox a").click(function(e){ 
136		e.preventDefault();
137		$.fancybox.close();
138        window.open(this.href);
139	});
140	$(".post_list").fancybox({
141		'cyclic':false,
142		'overlayOpacity':0.9,
143		'overlayColor':'#000',
144		'padding':0,
145		'titlePosition':'outside',
146		'titleFormat': function(title){
147			return title.replace(/\n/g,'<br />');
148		},
149		'onStart': function(){
150			document.getElementById('fb_css').href = 'pc/area/common/fancybox/jquery.fancybox-1.3.4_postlist.css';
151			var elemStyle = document.getElementById("fancybox-outer").style;
152			elemStyle.border = 'none';
153			elemStyle.background = 'none';
154		},
155		'onClosed': function(){
156			document.getElementById('fb_css').href = 'pc/area/common/fancybox/jquery.fancybox-1.3.4.css'; //元に戻す
157			var elemStyle = document.getElementById("fancybox-outer").style;
158			elemStyle.border = '';
159			elemStyle.background = '';
160		}
161	});
162	//角丸
163	$('.pager ul li a').corner("8px");
164	$('.pager li span.now').corner("8px");
165	$('.icon-member span.member').corner("4px");
166	$('.icon span.category').corner("4px");
167	$('.category-title .description').corner("4px");
168	$('.article-area .member-profile').corner("4px");
169	$('.event-area .nav-link-golist span').corner("4px");
170	$('.culture-area .nav-link-golist span').corner("4px");
171	$('.nav-link-category table').corner("4px");
172	$('.present-area .nav-link-golist span').corner("4px");
173	$('.tokuhain-area .category-title .description').corner("4px");
174	$('input#keyword_button').corner("4px");
175
176    //bxSlider
177	$('.bxslider').bxSlider({
178		auto: true,
179		controls: true,
180		speed: 1000,
181		pause:4000,
182		preloadImages:'all',
183		onSliderLoad: function(){
184        	$("#slider").css({
185	        	visibility:'visible'
186        	});
187        	$("#slider-wrap").css({
188        		backgroundImage:'none'
189        	});
190		}
191	});
192
193	// TOP フィーチャーバナー【new】
194	$('.bxslider-feature').bxSlider({
195		auto: true,
196		pause:4000,
197		speed:1000,
198		minSlides: 3,
199		maxSlides: 3,
200		moveSlides:1,
201		slideWidth: 320,
202		pager: true,
203		onSliderLoad: function(){
204	    	$("#feature_slider").css({
205	        	visibility:'visible',
206	    	});
207	    	$("#feature_slider-wrap").css({
208	    		background:'url(../img/bg_img.gif)',
209	    	});
210	    	objectFitImages('img.feature_img');
211		}
212	});
213
214	// TOP おすすめ枠
215	if($('.bxslider-recommend').length) {
216		if($('.bxslider-recommend ul').length !== 1) {
217			o_pager = o_controls = o_loop = true;
218		// 1ページの場合左右矢印とループ処理はfalseに設定
219		}else{
220			o_pager = o_controls = o_loop = false;
221		}
222		$('.bxslider-recommend').bxSlider({
223			pager: o_pager,
224				buildPager: (n) => {
225					return '<span>' + String(n + 1).padStart(2, '0') + '</span>'
226				},
227			controls: o_controls,
228			autoControlsCombine: true,
229			infiniteLoop: o_loop,
230			hideControlOnEnd: true,
231			pause:10000,
232		});
233	}
234
235	$('.culture_slides').bxSlider({
236		pager: false,
237		slideWidth: 200,
238		infiniteLoop: false,
239		onSliderLoad: function(){
240		    $('.bx-prev').css('margin-left', '-60px');
241		    $('.bx-next').css('margin-right', '-60px');
242		    $('.culture_slides').find('img').each(function(){
243		      $(this).css({'display': 'block', 'margin': '0 auto'});
244		    });
245	  	},
246	});
247
248	$('.hiroshima_culture_slider').bxSlider({
249		auto: true,
250		pause:4000,
251		speed:1000,
252		minSlides: 2,
253		maxSlides: 2,
254		moveSlides:1,
255		slideWidth: 320,
256		pager: true,
257		onSliderLoad: function(){
258	    	jQuery("#hiroshima_slider").css({
259	        	visibility:'visible',
260	    	});
261	    	jQuery("#hiroshima_slider-wrap").css({
262	    		background:'url(../img/bg_img.gif)',
263	    	});
264	    	objectFitImages('img.hiroshima_cl');
265		}
266	});
267
268	$('.culture_slides').bxSlider({
269	    pager: false,
270	    slideWidth: 200,
271	    infiniteLoop: false,
272	    onSliderLoad: function(){
273	      	$('.bx-prev').css('margin-left', '-60px');
274	      	$('.bx-next').css('margin-right', '-60px');
275	      	$('.culture_slides').find('img').each(function(){
276	        	$(this).css({'display': 'block', 'margin': '0 auto'});
277	    	});
278	    },
279	});
280
281	// おさかなコーナー
282	$('.bxslider-osakana').bxSlider({
283		auto: true,
284		pause:4000,
285		speed:1000,
286		minSlides: 3,
287		maxSlides: 3,
288		moveSlides:1,
289		slideWidth: 320,
290		pager: true,
291		onSliderLoad: function(){
292	    	$("#osakana_slider").css({
293	        	visibility:'visible',
294	    	});
295	    	$("#osakana_slider-wrap").css({
296	    		background:'url(../img/bg_img.gif)',
297	    	});
298	    	objectFitImages('img.osakana_img');
299		}
300	});
301
302    //pr-area bannerが無いの場合は、pr-areaを非表示
303    if($('.pr-area').height() == 0){
304        $('.pr-area').hide();
305    }
306
307	// まとめ記事へ戻るボタン
308	var collectId = jQuery("input[name='collect_id']").val();
309	if(document.referrer.indexOf(collectId) != -1 && document.referrer.indexOf(collectId) != 0){
310		$(".collect-post-btn").css("display", "block");
311	}
312
313	if ($('.order-switcher').length) {
314		if (location.search.indexOf('order=pv') != -1) {
315			jQuery('.order-switcher li').last().removeClass('off');
316		} else {
317			jQuery('.order-switcher li').first().removeClass('off');
318		}
319	}
320});
321
322jQuery(window).load(function(){
323	var sec = 1000*60*60*24*popupSec;
324	var term = new Date((new Date()).valueOf() + sec);
325    var visit_cnt = jQuery.cookie('visit_count_'+popupNo);
326
327    //スクロールが100に達したらボタン表示
328    jQuery(window).scroll(function () {
329        if (jQuery(this).scrollTop() > 300) {
330			jQuery('#ad-floating, #ad-floating .delete').fadeIn( "slow" );
331        } else {
332            jQuery('#ad-floating, #ad-floating .delete').fadeOut( "slow" );
333        }
334    });
335	jQuery('#ad-floating .delete').click(function() {
336		jQuery('#ad-floating, #ad-floating .delete').fadeOut( "slow" );
337		setTimeout(function(){
338			jQuery('#ad-floating').attr('id', '');
339			jQuery.cookie('visit_count_'+popupNo, popupCnt, { expires: term, path:'/'});
340			jQuery.cookie('popup_hide_set', 'set', { expires: term, path:'/'});
341		},500);
342	});
343});

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.