PageSourceSearch

https://miuraclinic-iwazu.com/style/js/common.js?20261005195732

js miuraclinic-iwazu.com collected 2026-10-05 10:57:45 UTC 8,464 bytes, 342 lines download raw bytes

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

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.