PageSourceSearch

https://musashino-chuou.com/data/common/c1001a072201/js/script.js

js musashino-chuou.com collected 2026-10-04 19:41:02 UTC 9,079 bytes, 256 lines download raw bytes

1// import { TweenLite, TimelineMax, TweenMax } from "gsap";
2// declare module "gsap"{
3// 	export interface TweenConfig{
4// 		[p:string]: any;
5// 	}
6// }
7// JavaScript Document
8/**
9 * 使用javascriptライブラリ
10 * Modernizr
11 * TweenMax
12 * Swiper
13 */
14let img = document.getElementsByTagName('img');
15let imgNum = img.length;
16// SVGがダメなブラウザは<img>タグのSVGファイルはpngに変換
17function svgTopng() {
18    //console.log(img)
19    if (!Modernizr.svg) {
20        for (var i = 0; i < imgNum; i++) {
21            var src = img[i].getAttribute('src'), reSrc = src.replace(/\.svg/gi, '.png');
22            img[i].setAttribute('src', reSrc);
23        }
24    }
25    return;
26}
27;
28// 変数リスト
29const mainBlock = document.getElementById('main'), pagetitle = document.getElementById('title');
30// ここから下は読み込みが完了してから実行する。
31window.onload = function () {
32    svgTopng();
33    // TOPのslider
34    // スライド対象の指定
35    var slidebox = document.getElementsByClassName('swiper-container')[0];
36    // 実行処理内容
37    function sliderfunc(slideelm) {
38        if (Modernizr.flexbox) {
39            var swiper = new Swiper(slidebox, {
40                speed: 1000,
41                spaceBetween: 0,
42                slidesPerView: 'auto',
43				autoHeight: true,
44                centeredSlides: true,
45                loop: true,
46                pagination:false,// {
47                    //el: '.swiper-pagination',
48                   // clickable: true,
49                //},
50                navigation: {
51                    nextEl: '.swiper-button-next',
52                    prevEl: '.swiper-button-prev',
53                },
54                autoplay: {
55                    delay: 3000,
56                },
57				breakpoints: {
58				  980: {
59					slidesPerView: 1,
60					autoHeight: true,
61				  }
62				}
63            });
64        }
65        ;
66    }
67    ;
68    sliderfunc(slidebox);
69    
70    // END:TOPのslider
71
72
73    // 汎用レイアウト内のページ上部へスクロールするボタンのアクション
74    if (mainBlock != null) {
75        let pagetopbox = mainBlock.getElementsByClassName('pagetop');
76        if (pagetopbox.length !== 0) {
77            function commonsidepageTop(pagetopelm) {
78                if (0 < pagetopelm.length) {
79                    var pagetopelm = pagetopelm, pagetopboxNum = pagetopelm.length, pagetopAtag = [];
80                    for (var i = 0; i < pagetopboxNum; i++) {
81                        pagetopelm[i].querySelector('a').addEventListener('click', function (event) {
82                            event.preventDefault();
83                            TweenMax.to(window, 0.4, { scrollTo: 0 });
84                        });
85                    }
86                    return pagetopelm;
87                }
88            }
89            ;
90            commonsidepageTop(pagetopbox);
91        }
92    }
93    // END:汎用レイアウト内のページ上部へスクロールするボタンのアクション
94    // リンクをボックス全体に適用、WCでblank指定されている場合も設定を反映
95    var linkboxtxt = document.querySelectorAll('.wlkb'); //指定クラス内のaタグのリンクを指定クラス親要素に対して付与
96    // 例:li>p.wlkb>a[href="index.html"] はli要素全体がクリック可能となる。
97    function linkwrap(linkBoxWrapelm) {
98        if (linkBoxWrapelm.length != 0) {
99            let linkhref = [], boxNum = linkBoxWrapelm.length;
100            for (let i = 0; i < boxNum; i++) {
101                linkhref = linkBoxWrapelm[i].getElementsByTagName('a')[0];
102                if (linkhref != null) {
103                    let linkLi = linkhref.parentNode.parentNode, ahref = linkhref.getAttribute('href');
104                    linkLi.addEventListener('mouseover', function (event) {
105                        this.classList.add('onhover');
106                        this.style.cursor = 'pointer';
107                    });
108                    linkLi.addEventListener('mouseout', function (event) {
109                        this.classList.toggle('onhover');
110                    });
111                    linkLi.addEventListener('click', function (event) {
112                        let linkclass = this.querySelector('a').getAttribute('class'), linkBlank = this.querySelector('a').getAttribute('target');
113                        ahref = this.querySelector('a').getAttribute('href');
114                        if (linkclass === 'wctr_blank' || linkBlank === '_blank') {
115                            event.preventDefault();
116                            window.open(ahref);
117                        }
118                        else {
119                            event.preventDefault();
120                            window.location.href = ahref;
121                        }
122                    });
123                }
124            }
125        }
126        ;
127        return linkBoxWrapelm;
128    }
129    ;
130    linkwrap(linkboxtxt);
131    // トップカテゴリ部分
132    var linkboxtxt2 = document.getElementsByClassName('top-category');
133    function linkwrap2(linkBoxWrapelm2) {
134        if (linkBoxWrapelm2.length != 0) {
135            let boxNum = linkBoxWrapelm2.length;
136            for (let i = 0; i < boxNum; i++) {
137                let liElm = linkboxtxt2[i].getElementsByTagName('li');
138                for (let i = 0; i < liElm.length; i++) {
139                    liElm[i].addEventListener('mouseover', function (ev) {
140                        this.classList.add('onhover');
141                    });
142                    liElm[i].addEventListener('mouseout', function (ev) {
143                        this.classList.toggle('onhover');
144                    });
145                }
146            }
147        }
148        return linkBoxWrapelm2;
149    }
150    ;
151    linkwrap2(linkboxtxt2);
152    // close:window.onload = function()
153};
154(function ($) {
155    $(function () {
156        // LightBox2 Script function 画像へのリンクが対象
157         $('a[href$=".jpg"], a[href$=".jpeg"], a[href$=".gif"], a[href$=".png"]').each(function(index, elm){
158         	$(this).attr('data-lightbox', 'image');
159         	var imageTitle = $('img', this).attr('alt');
160         	$(this).attr('data-title', imageTitle).attr('title', imageTitle);
161         });
162        // // LightBox Option
163         lightbox.option({
164         	alwaysShowNavOnTouchDevices: true,
165         	fadeDuration: 200,
166         	imageFadeDuration: 200
167         });
168        // jQuery
169        /*  ============================  */
170/*toggle openbox*/
171
172	$(".show_more dt,.md-bosyu h3").on("click", function() {
173		$(this).next().slideToggle(); 
174		$(this).toggleClass("active"); 
175	});
176// タブに対してクリックイベントを適用
177	const tabs = document.getElementsByClassName('tab');
178	for(let i = 0; i < tabs.length; i++) {
179		tabs[i].addEventListener('click', tabSwitch);
180	}
181
182	// タブをクリックすると実行する関数
183	function tabSwitch(){
184		// タブのclassの値を変更
185		document.getElementsByClassName('is-active')[0].classList.remove('is-active');
186		this.classList.add('is-active');
187		// コンテンツのclassの値を変更
188		document.getElementsByClassName('is-show')[0].classList.remove('is-show');
189		const arrayTabs = Array.prototype.slice.call(tabs);
190		const index = arrayTabs.indexOf(this);
191		document.getElementsByClassName('w-news')[index].classList.add('is-show');
192	};
193		
194		//dwawerメニュー
195        $('.drawer').drawer({
196            iscroll: {
197                scrollX: false,
198                scrollY: true,
199                click: true,
200                mouseWheel: true,
201                disablePointer: true,
202                disableTouch: false,
203                disableMouse: false
204            },
205            iscroll: {
206            // Configuring the iScroll
207            // https://github.com/cubiq/iscroll#configuring-the-iscroll
208               mouseWheel: true,
209               preventDefault: false
210            },
211        });
212		$('.drawer-dropdown li').on('click', function() {
213        $('.drawer').drawer('close');
214		});
215
216
217		var $win = $(window),
218            $spDn = $('.drawer-hamburger');
219		    
220
221        $win.on('load resize', function() {
222          if ($spDn.is(':hidden')) {
223            $('.dropdown-toggle').click(function() {
224              var location = $(this).attr('href');
225              window.location.href = location;
226              return false;
227            });			  
228          }
229        });
230		
231    });
232	
233})(jQuery);
234function smartRollover() {
235	if(document.getElementsByTagName) {
236		var images = document.getElementsByTagName("img");
237		for(var i=0; i < images.length; i++) {
238			if(images[i].getAttribute("src").match("_off.")) {
239				images[i].onmouseover = function() {
240					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
241				}
242				images[i].onmouseout = function() {
243					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
244				}
245			}
246		}
247	}
248}
249if(window.addEventListener) {
250	window.addEventListener("load", smartRollover, false);
251}
252else if(window.attachEvent) {
253	window.attachEvent("onload", smartRollover);
254}
255
256//# sourceMappingURL=script.js.map

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.