PageSourceSearch

https://hagiwara-ukai.com/style/js/common.js?20261008185625

js hagiwara-ukai.com collected 2026-10-08 09:56:35 UTC 8,870 bytes, 374 lines download raw bytes

1// JavaScript Document
2/* btnGlobalnavi */
3var quux,quuux;
4$(window).on('load scroll',function(){
5  quux = $(this).scrollTop();
6});
7
8$('#btnGlobal').on('click',function(){
9		$('#btnGlobal').toggleClass('active');
10				$('#spGrandMenu').slideToggle('slow');
11		
12		if($('#btnGlobal').hasClass('active')){
13		$('#mainContainer').css('position','fixed');
14  quuux = quux;
15  $('#mainContainer').css('top','-'+quux +'px');
16		
17    } else {
18					
19  $('#mainContainer').css('position','');
20  $('#mainContainer').css('top','');
21		$(window).scrollTop(quuux);
22    }
23});
24
25
26// sp menu
27var windowWidth = $(window).width();
28var windowSm = 767;
29if (windowWidth <= windowSm) {
30
31/* sp Only ------------------------------- */
32
33$("#navGlobal").each(function() {
34 var accordion = $(this);
35 $(this).find(".btn-navChild a").click(function() {
36 var targetContentWrap = $(this).next(".navChild");
37 if ( targetContentWrap.css("display") === "none" ) {
38 accordion.find(".navChild").slideUp();
39 accordion.find(".btn-navChild a.active").removeClass("active");
40 }
41 targetContentWrap.slideToggle();
42 $(this).toggleClass("active");
43 });
44});
45
46$(function()
47{
48  $('body').find('[data-sp-href]').each(function()
49  {
50      $(this).attr('href', $(this).attr('data-sp-href'));
51  });
52});
53
54$(document).ready(function() {
55 var headerHight = 60;
56    $('a[href^="#"]:not([href$="#"])').click(function() {
57        var href = $(this).attr('href');
58        var pos = $(href).offset().top-headerHight;
59        var duration = 600;
60        $('body, html').animate({ scrollTop: pos }, duration, 'linear');
61        return false;
62    });
63  });
64
65
66} else {
67
68/* pc Only ------------------------------- */
69
70 $(function() {
71    $('a[href^="#"]:not([href$="#"])').click(function() {
72        var href = $(this).attr('href');
73        var pos = $(href).offset().top;
74        var duration = 600;
75        $('body, html').animate({ scrollTop: pos }, duration, 'linear');
76        return false;
77    });
78});
79
80 $(function() {
81  // フェードインしながら上へスライド     
82  $('.inviewfadeInUp').on('inview', function(event, isInView, visiblePartX, visiblePartY) {
83      if (isInView) {
84          $(this).stop().addClass('fadeInUp');
85      } else {
86          $(this).stop().removeClass('fadeInUp');
87      }
88  });
89});
90
91
92}
93
94/* common ------------------------------- */
95
96
97// load rewrite
98var timer = false;
99var w = 0;
100
101//ロード時
102$(window).load(function() {
103    w = $(window).width();
104});
105
106//リサイズ時
107$(window).resize(function() {
108    if (timer !== false) {
109        clearTimeout(timer);
110    }
111    timer = setTimeout(function() {
112        if($(window).width() != w){
113            location.reload();
114            w = $(window).width();
115        }
116    }, 200);
117});
118
119
120
121$(function(){
122  //clickable
123  $(".clickable").click(function(){
124    if($(this).find("a").attr("target")=="_blank"){
125         window.open($(this).find("a").attr("href"), '_blank');
126     }else{
127         window.location=$(this).find("a").attr("href");
128     }    return false;
129  });
130
131// scroll top
132
133$(function() {
134	$(window).scroll(function () {
135		var s = $(this).scrollTop();
136		var m = 300;
137		if(s > m) {
138			$("#pagetop").fadeIn('slow');
139		} else if(s < m) {
140			$("#pagetop").fadeOut('slow');
141		}
142	});
143});
144
145// visual switch
146var $elem = $('.js-image-switch');
147var sp = '_sp.';
148var pc = '_pc.';
149var replaceWidth = 768;
150
151function imageSwitch() {
152  var windowWidth = parseInt($(window).width());
153  $elem.each(function() {
154    var $this = $(this);
155    if(windowWidth >= replaceWidth) {
156      $this.attr('src', $this.attr('src').replace(sp, pc));
157    } else {
158      $this.attr('src', $this.attr('src').replace(pc, sp));
159    }
160  });
161}
162imageSwitch();
163
164//map
165$(function(){
166var canvas = document.getElementById( 'gMap' ) ;
167var latlng = new google.maps.LatLng( 35.355957 , 132.756685 );
168var mapOptions = {
169	zoom: 17 ,
170	center: latlng ,
171 scrollwheel: false, 
172 streetViewControl:false,
173 mapTypeControl:false,
174 zoomControl: false,
175 draggable: false,
176};
177var map = new google.maps.Map( canvas , mapOptions ) ;
178var markers = [] ;
179markers[0] = new google.maps.Marker({
180	map: map ,
181	position: new google.maps.LatLng( 35.355957 , 132.756685 ) ,
182});
183
184});
185
186
187// sp tel
188if(window.addEventListener){
189	window.addEventListener( "load" , syncerTelephoneLink, false );
190}else{
191	window.attachEvent( "onload", syncerTelephoneLink );}
192function syncerTelephoneLink(){
193	var width = window.innerWidth ;
194	if( width>=768 ){ return false ; }
195	var elms = document.getElementsByClassName( "syncer-tel" ) ;
196	for( var i=0,l=elms.length; l>i; i++ ){
197		var elm = elms[i] ;
198		var number = elm.getAttribute( "data-number" ) ;
199		if( number!=null ){
200			if( elm.tagName == "A" )	{
201				elm.href = "tel:" + number ;
202			}else{
203				var text = elm.innerHTML ;
204				elm.innerHTML = '<a href="tel:' + number + '">
204' + text + '</a>' ;
205			}
206		}
207	}
208};
209
210
211// loop slider
212	var setElm = $('.loopSlider'),
213	slideSpeed = 18000;
214
215	setElm.each(function(){
216		var self = $(this),
217		selfWidth = self.innerWidth(),
218		findUl = self.find('ul'),
219		findLi = findUl.find('li'),
220		listWidth = findLi.outerWidth(),
221		listCount = findLi.length,
222		loopWidth = listWidth * listCount;
223
224		findUl.wrapAll('<div class="loopSliderWrap" />');
225		var selfWrap = self.find('.loopSliderWrap');
226
227		if(loopWidth > selfWidth){
228			findUl.css({width:loopWidth}).clone().appendTo(selfWrap);
229
230			selfWrap.css({width:loopWidth*2});
231
232			function loopMove(){
233				selfWrap.animate({left:'-' + (loopWidth) + 'px'},slideSpeed*listCount,'linear',function(){
234					selfWrap.css({left:'0'});
235					loopMove();
236				});
237			};
238			loopMove();
239
240			setElm.hover(function() {
241				selfWrap.pause();
242			}, function() {
243				selfWrap.resume();
244			});
245		}
246	});
247
248/* loopslider css
249.loopSliderWrap {
250    top: 0;
251    left: 0;
252    height: 210px;
253    overflow: hidden;
254    position: absolute;
255}
256 
257.loopSlider {
258    margin: 0 auto;
259    width: 100%;
260    height: 210px;
261    text-align: left;
262    position: relative;
263    overflow: hidden;
264}
265 
266.loopSlider ul {
267    height: 210px;
268    float: left;
269    overflow: hidden;
270}
271 
272.loopSlider ul li {
273    width: 315px;
274    height: 210px;
275    float: left;
276    display: inline;
277    overflow: hidden;
278}
279
280*/
281
282});
283
284
285/******************************************************
286 ** File Name : medica.js powered by yuga.js
287 ** Creater : miura@MMP
288 ** Summary : custom yuga.js
289 ** Modified : 2008.07.29
290/ *****************************************************
291/*
292 * yuga.js 0.7.1 - 優雅なWeb制作のためのJS
293 *
294 * Copyright (c) 2009 Kyosuke Nakamura (kyosuke.jp)
295 * Licensed under the MIT License:
296 * http://www.opensource.org/licenses/mit-license.php
297 *
298 * Since:     2006-10-30
299 * Modified:  2009-01-27
300 *
301 * jQuery 1.3.1
302 * ThickBox 3.1
303 */
304
305
306(function($) {
307
308	$(function() {
309		$.yuga.selflink();
310	});
311
312	//---------------------------------------------------------------------
313
314	$.yuga = {
315		// URIを解析したオブジェクトを返すfunction
316		Uri: function(path){
317			var self = this;
318			this.originalPath = path;
319			//絶対パスを取得
320			this.absolutePath = (function(){
321				var e = document.createElement('span');
322				e.innerHTML = '<a href="' + path + '" />';
323				return e.firstChild.href;
324			})();
325			//絶対パスを分解
326			var fields = {'schema' : 2, 'username' : 5, 'password' : 6, 'host' : 7, 'path' : 9, 'query' : 10, 'fragment' : 11};
327			var r = /^((\w+):)?(\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/.exec(this.absolutePath);
328			for (var field in fields) {
329				this[field] = r[fields[field]];
330			}
331			this.querys = {};
332			if(this.query){
333				$.each(self.query.split('&'), function(){
334					var a = this.split('=');
335					if (a.length == 2) self.querys[a[0]] = a[1];
336				});
337			}
338		},
339		//現在のページと親ディレクトリへのリンク
340		selflink: function (options) {
341			var c = $.extend({
342				selfLinkAreaSelector:'body',
343				selfLinkClass:'current',
344				parentsLinkClass:'parentsLink',
345				postfix: '_cr',
346				changeImgSelf:false,
347				changeImgParents:false
348			}, options);
349			$(c.selfLinkAreaSelector+((c.selfLinkAreaSelector)?' ':'')+'a[href]').each(function(){
350				var href = new $.yuga.Uri(this.getAttribute('href'));
351				var setImgFlg = false;
352				if ((href.absolutePath == location.href) && !href.fragment) {
353					//同じ文書にリンク
354					$(this).addClass(c.selfLinkClass);
355					setImgFlg = c.changeImgSelf;
356				} else if (0 <= location.href.search(href.absolutePath)) {
357					//親ディレクトリリンク
358					$(this).addClass(c.parentsLinkClass);
359					setImgFlg = c.changeImgParents;
360				}
361				if (setImgFlg){
362					//img要素が含まれていたら現在用画像(_cr)に設定
363					$(this).find('img').each(function(){
364						this.originalSrc = $(this).attr('src');
365						this.currentSrc = this.originalSrc.replace(new RegExp('('+c.postfix+')?(\.gif|\.jpg|\.png)$'), c.postfix+"$2");
366						$(this).attr('src',this.currentSrc);
367					});
368				}
369			});
370		}
371	};
372})(jQuery);
373
374

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.