PageSourceSearch

https://bisilent.com/wp-content/themes/bisilent/js/function.js

js bisilent.com collected 2026-10-02 00:15:40 UTC 7,048 bytes, 278 lines download raw bytes

1/*
2
3Last UpDate 2017-06-12
4
5*/
6
7$(function(){
8	//現在居るファイル名	   
9	var currentFile = location.href.split('/').pop();
10	
11	//ua取得
12	var ua = navigator.userAgent;
13	
14	// モバイルメニュー
15	try{	
16		var navBox = $('#global-nav');
17		
18		$("#header .navbtn").click(function() {
19			$(navBox).slideToggle('open');
20			$('.navbtn').toggleClass('move');
21		});
22	
23		$(window).on('load resize', function(){
24			$(navBox).slideUp('open');
25		});
26		//end
27		
28		// モバイルメニューをクリックしたら消す
29		$('#global-nav li a').click(function(){
30			$('#global-nav').hide();
31			$('.navbtn').removeClass('move');
32		});
33		
34		// アンカーリンク設定
35		$('#global-nav li a').click(function() {
36			var speed = 400;
37			var href= $(this).attr("href");
38			var target = $(href == "#" || href == "" ? 'html' : href);
39			var headerHeight = 60; //固定ヘッダーの高さ
40			var position = target.offset().top - headerHeight; //ターゲットの座標からヘッダの高さ分引く
41			$('body,html').animate({scrollTop:position}, speed, 'swing');
42			return false;
43		});
44		
45		
46	}catch(e){}
47	
48	
49	/* ウィンク効果 */
50	
51	$(".wink a img").mouseover(function(){
52		$(this).css("opacity", "0.2");
53		$(this).css("filter", "alpha(opacity=20)");
54		$(this).fadeTo("slow", 1.0);
55	});
56	
57	$('#header h1 a img').mouseover(function(){
58		$(this).css('opacity', '0.2');
59		$(this).css('filter', 'alpha(opacity=20)');
60		$(this).fadeTo('slow', 1.0);
61	});
62	
63	
64	// colorbox
65	try{
66		
67		/*
68		$('.colorbox img').parent('a').colorbox({
69			transition: "elastic",
70			speed: 500,
71			maxWidth: '90%',
72			maxHeight:'90%'
73		});
74		*/
75		
76		$('.popup').colorbox({
77			inline: true,
78			returnFocus:false,
79			maxWidth:"90%"
80		});
81		
82		
83		$('.close').on('click', function(e){
84			/*e.preventDefault();*/
85			$.colorbox.close();
86			
87		});
88		
89		
90	}catch(e){}
91	
92	
93	//rollover
94	$('a img').each(function(){
95		var imgSrc = $(this).attr('src');
96		//smartRollover
97		if(imgSrc.match(/(.*)_off(\..*)/)){
98			var repSrc = RegExp.$1+'_on'+RegExp.$2;
99			$('<img />').attr('src',repSrc);
100			$(this).hover(function(){
101				$(this).attr('src',repSrc);
102				$(this).css({opacity: '1',filter: 'alpha(opacity=100)'});
103			},function(){
104				$(this).attr('src',imgSrc);
105			});
106		
107		//on画像を除外
108		}else if(imgSrc.match(/(.*)_on(\..*)/)){
109		//ロールオーバーが無い場合は、透明度80%
110		}else if(!$(this).hasClass('not')){
111			$(this).hover(function(){
112					$(this).css({
113						opacity: '0.8',
114						filter: 'alpha(opacity=80)'
115					});
116			},function(){
117					$(this).css({
118						opacity: '1',
119						filter: 'alpha(opacity=100)'
120					});
121			});
122		}
123	});
124	
125	
126	// 読み込み時ウィンドウサイズによって画像を変更する
127	try{
128		var wid = $(window).width();
129		var size = 640; //ウィンドウサイズ
130		if(wid > size){
131			$('img').each(function(){
132				$(this).attr("src",$(this).attr("src").replace(/^(.*)_sp.(.*)$/,'$1_pc.$2'));
133			});
134		} else {
135			$('img').each(function(){
136				$(this).attr("src",$(this).attr("src").replace(/^(.*)_pc.(.*)$/,'$1_sp.$2'));
137			});
138		}
139
140		// ウィンドウサイズをリサイズした時
141		$(window).resize(function(){
142			if(wid > size){
143				$('img').each(function(){
144					$(this).attr("src",$(this).attr("src").replace(/^(.*)_sp.(.*)$/,'$1_pc.$2'));
145				});
146			} else {
147				$('img').each(function(){
148					$(this).attr("src",$(this).attr("src").replace(/^(.*)_pc.(.*)$/,'$1_sp.$2'));
149				});
150			}
151		});
152
153	}catch(e){}
154	
155	
156	// メインスライド
157	try{
158		
159		
160		
161	}catch(e){}
162	
163	
164	
165	
166	// #footerコピーライトの年を動的に書き換え
167	try{
168		var year = new Date().getFullYear();
169		var copyTxt = $('#footer address').html();
170		if(copyTxt.match(/([0-9]{4}-)?([0-9]{4})/) != null){
171			var repTxt = copyTxt.replace(RegExp.$2,year);
172			$('#footer address').html(repTxt);
173		}
174	}catch(e){}
175	
176	
177	// 電話番号リンク(スマホ)
178	try{
179		if(navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/)){
180			$('.tellink').each(function() {
181			//.tellink内のHTMLを取得
182			var str = $(this).html();
183			//子要素がimgだった場合、alt属性を取得して電話番号リンクを追加
184			if ($(this).children().is('img')) {
185			  $(this).html($('<a>').attr('href', 'tel:' + $(this).children().attr('alt').replace(/-/g, '')).append(str + '</a>'));
186			} else {
187			//それ以外はテキストを取得して電話番号リンクを追加
188			  $(this).html($('<a>').attr('href', 'tel:' + $(this).text().replace(/-/g, '')).append(str + '</a>'));
189			}
190		  });
191		}
192	}catch(e){}
193	
194	
195	// スクロールでfadein
196	try{
197		$('.fadein').css('visibility','hidden');
198		$(window).scroll(function(){
199		 var windowHeight = $(window).height(),
200			 topWindow = $(window).scrollTop();
201		 $('.fadein').each(function(){
202			 
203			 if(navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/)){
204			 	var targetPosition = $(this).offset().top;
205		  		if(topWindow > targetPosition - windowHeight + 100){
206		   			$(this).addClass('fadeInDown');
207		  		}
208		  	} else {
209				var targetPosition = $(this).offset().top;
210		  		if(topWindow > targetPosition - windowHeight + 200){
211		   			$(this).addClass('fadeInDown');
212		  		}
213			}
214		 });
215		});
216	}catch(e){}
217	
218	// homeスライド
219	try{
220		var _width = $(window).width();//デバイス(ウィンドウ)幅を取得
221		if(_width <= 1024 ){
222			$('.bxslider').bxSlider({
223				mode: 'fade',
224				pause: 4000,  
225				speed: 1000,  
226				auto: true,
227				controls: false,
228				pager: false,
229			});
230		} else {		
231			$('#slider').vegas({	
232				delay: 7000,
233				timer: false,
234				transition: 'blur',
235				transitionDuration: 1500,
236				slides: [
237					{ src: './image/new_slide01.jpg' },
238					{ src: './image/new_slide02.jpg' },
239					{ src: './image/new_slide03.jpg' }
240				]
241			});
242		}
243	}catch(e){}
244	
245	// gallery
246	try{
247		$('.bxslider01').bxSlider({
248  			pagerCustom: '#bx-pager',  //ページャーをサムネイルにする
249  			controls:false//前後の矢印を消す
250  		});
251
252		var wid = $(window).width();
253		var size = 1024; //ウィンドウサイズ
254		if(wid > size){
255			$('.bxslider02').bxSlider({
256				pager:false,
257				minSlides: 8,  //1スライド内のサムネイルの数
258				maxSlides: 8,  //1スライド内のサムネイルの最大数
259				slideWidth: 130,  //サムネイルの横幅(単位はpx)
260				slideMargin: 5,  //サムネイル間の余白(単位はpx)
261				nextSelector: '#NextIcon',  //"次へ"矢印をカスタマイズするための記述
262				prevSelector: '#PrevIcon'//"前へ"矢印をカスタマイズするための記述
263			});
264		} else {
265			$('.bxslider02').bxSlider({
266				pager:false,
267				minSlides: 4,  //1スライド内のサムネイルの数
268				maxSlides: 4,  //1スライド内のサムネイルの最大数
269				slideWidth: 130,  //サムネイルの横幅(単位はpx)
270				slideMargin: 5,  //サムネイル間の余白(単位はpx)
271				nextSelector: '#NextIcon',  //"次へ"矢印をカスタマイズするための記述
272				prevSelector: '#PrevIcon'//"前へ"矢印をカスタマイズするための記述
273			});
274		}
275	}catch(e){}
276	
277	
278});

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.