PageSourceSearch

https://www.sbc-dental.com/lp_pr/ceramic3/js/main.js

js sbc-dental.com collected 2026-10-04 10:15:01 UTC 8,703 bytes, 247 lines download raw bytes

1$(function() {
2    //load delay
3    $(".fadeinwrap").children().addClass("fadein");
4    // $('.fadein').scrollFade();
5    $(window).scroll(function() {
6        $('.fadein').each(function() {
7            var elemPos = $(this).offset().top;
8            var scroll = $(window).scrollTop();
9            var windowHeight = $(window).height();
10            if (scroll > elemPos - windowHeight + 150) {
11                $(this).addClass('scrollin');
12            }
13        });
14    });
15
16    //fixed button
17    var fixed = $('.button-cv');
18    var triggerNode = $(".doctor");
19    fixed.hide();
20    $(window).on("scroll", function() {
21        var triggerNodePosition = $(triggerNode).offset().top - $(window).height();
22
23        if ($(this).scrollTop() > 100 && $(this).scrollTop() < triggerNodePosition) {
24            $(fixed).slideDown("fast");
25        } else {
26            $(fixed).slideUp("fast");
27        }
28    });
29
30    //smooth scroll
31    $('a[href^=#]').click(function() {
32        var speed = 800;
33        var href = $(this).attr("href");
34
35        var target = $(href == "#" || href == "" ? 'html' : href);
36
37        var position = target.offset().top;
38
39        $('body,html').animate({ scrollTop: position }, speed, 'swing');
40        return false;
41    });
42
43    $("img.over").mouseover(function() {
44        $(this).attr("src", $(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"));
45    }).mouseout(function() {
46        $(this).attr("src", $(this).attr("src").replace(/^(.+)_o(\.[a-z]+)$/, "$1$2"));
47    }).each(function() {
48        $("<img>").attr("src", $(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"));
49    });
50
51	CalendarControle();
52
53	calerr = 0;
54	$("form").on("submit",function(){
55		if (calerr){ $.tomsDialog({type:'ok',message:'希望日を正しく選択して下さい'}); return false; }
56	});
57});
58
59	/* カレンダ制御 */
60	function CalendarControle(){
61		var debug;
62
63		$("select[name^=pref1]").change(function(){ cal_check(); });
64		$("select[name^=pref2]").change(function(){ cal_check(); });
65		$("select[name^=pref3]").change(function(){ cal_check(); });
66		$("input[name=submit]").click(function(){
67			var res = cal_check();
68			if (res == -1){ return false; }
69		});
70
71		function cal_check(){
72			calerr = 0;
73			var ErrMsg = new Array();
74			var flag = {};
75			for (var ix = 1; ix <= 3; ix++ ){
76				var ob = 'pref'+ix;
77				var Sa = String($("select[name="+ob+"a]").val() || "");
78				var Sb = String($("select[name="+ob+"b]").val() || "");
79				var tm = $("select[name="+ob+"c]").val() || "";
80				if (tm.match(/終日/)){ flag[Sa+'/'+Sb] = 1; }
81			}
82			var cnt = {};
83			var dbl = {};
84			for (var ix = 1; ix <= 3; ix++ ){
85				var ob = 'pref'+ix;
86				var Sy;
87				var Sa = parseInt($("select[name="+ob+"a]").val());
88				var Sb = parseInt($("select[name="+ob+"b]").val());
89				var tm = $("select[name="+ob+"c]").val() || "";
90				if (Sa > 0 && Sb > 0){
91					var today = new Date();
92					var this_year = today.getFullYear();
93					var this_month = today.getMonth()+1;
94					var this_day = today.getDate();
95					// 今日より前か
96					if ( (this_month*30)+(this_day) >= (Sa*30)+Sb ){ Sy = this_year+1; } else { Sy = this_year; }
97					var dtS = new Date(Sy,Sa-1,Sb);
98					var mmS = dtS.getTime();
99					var pss = parseInt( (mmS - today)/1000/60/60/24 );
100					if ((this_month == Sa && this_day == Sb) || pss <= 1){
101						ErrMsg.push("▼第"+(ix)+"希望:<br>近日中のご予約につきましてはお電話にて承っております。<br>お手数ではございますが、下記番号までご連絡くださいませ。<br>TEL:0120-049-222<br>");
102					} else if (pss > 10*30){
103						ErrMsg.push("▼第"+(ix)+"希望:<br>予約可能な期間は300日以内です<br>");
104					} else { }
105				}
106				if (Sa != 0 && Sb != 0 && tm != ""){
107					var ak = String(Sa)+'/'+String(Sb)+' '+tm;
108					if (dbl[ak] == 1){
109						ErrMsg.push("▼第"+(ix)+"希望:<br>重複しています<br>");
110					} else { dbl[ak] = 1; }
111					var mk = String(Sa)+'/'+String(Sb);
112					if (flag[mk] && cnt[mk] == 1){
113						ErrMsg.push('▼終日を選択した同日は時間選択できません');
114					} else { cnt[mk] = 1; }
115				}
116			}
117			if (ErrMsg.length > 0){
118				debug = "日付指定エラー<br>"+ErrMsg.join("<br>");
119				$.tomsDialog({ type:"ok", message:debug });
120				calerr = 1;
121				return -1;
122			}
123		}
124	}
125
126(function($) {
127
128	/* tomsDialog */
129	$.tomsDialog = function(HK){
130
131		if ($("#light-dialog-panel").length){
132			setTimeout(function(){ tomsDialog(HK); },200);
133			return;
134		}
135
136		var type = HK.type || "pop";
137		var msg = HK.message || "";
138		var tm = HK.time || 1000;
139		var callback = HK.callback || function(){};
140		var callback_ok = HK.callback_ok || function(){};
141		var callback_cancel = HK.callback_cancel || function(){};
142		var bgcolor = HK.bgcolor || "#fff";
143		var shadowcolor = HK.shadowcolor || "#ddd";
144		var okbtn = HK.okbtn || "OK";
145		var cancelbtn = HK.cancelbtn || "キャンセル";
146
147		if (type == "pop"){
148
149			setBack(bgcolor);
150
151			$('<div/>',{
152				style: 'position:fixed; top:0px; left:0px; background-color:#fff; border:5px solid #ccc; border-radius:10px; padding:30px 50px; opacity:0; z-index:10001; user-select:none; box-shadow:5px 15px 10px '+shadowcolor+';',
153				id: 'light-dialog-panel'
154			}).appendTo('body').html(msg);
155
156			var R = $("#light-dialog-panel").getPos();
157
158			$("#light-dialog-panel")
159			.css({'top': (R.top+10)+'px','left': R.left+'px'})
160			.animate({'opacity':'1.0','top':R.top+'px'},300,function(){
161				$("#light-dialog-panel").animate({'padding':'30px 50px'},tm,function(){
162					$("#light-dialog-panel").animate({'opacity':'0.0','top':(R.top-20)+'px'},500,function(){
163						$("#light-dialog-panel").remove();
164						$("#white-back").remove();
165						callback();
166					});
167				});
168			});
169		}
170		else if (type == "confirm"){
171
172			setBack(bgcolor);
173
174			$('<div/>',{
175				style: 'position:fixed; top:0px; left:0px; background-color:#fff; border: 5px solid #ccc; border-radius: 10px; padding: 20px 50px; display: inline-block; text-align: center; z-index: 10001; user-select: none; box-shadow:5px 15px 10px '+shadowcolor+';',
176				html: '<div style="display:inline-block;text-align:left;">'+msg+'</div><br><div style="text-align:center;padding-top:20px;"><input type="button" id="light-dialog-panel-ok" value="'+okbtn+'"> <input type="button" id="light-dialog-panel-cancel" value="'+cancelbtn+'"></div>',
177				id: 'light-dialog-panel'
178			}).appendTo('body');
179
180			var R = $("#light-dialog-panel").getPos();
181
182			$("#light-dialog-panel")
183			.css({'top': (R.top+10)+'px','left': R.left+'px'})
184			.animate({'opacity':'1.0','top':R.top+'px'},300,function(){});
185
186			$("#light-dialog-panel").on("click","#light-dialog-panel-ok",function(){
187				$("#light-dialog-panel").animate({'opacity':'0.0','top':(R.top-20)+'px'},500,function(){
188					$("#light-dialog-panel").remove();
189					$("#white-back").remove();
190					callback();
191					callback_ok();
192				});
193			});
194
195			$("#light-dialog-panel").on("click","#light-dialog-panel-cancel",function(){
196				$("#light-dialog-panel").animate({'opacity':'0.0','top':(R.top-20)+'px'},500,function(){
197					$("#light-dialog-panel").remove();
198					$("#white-back").remove();
199					callback_cancel();
200				});
201			});
202
203		}
204		else if (type == "ok"){
205
206			setBack(bgcolor);
207
208			$('<div/>',{
209				style: 'position:fixed; top:0px; left:0px; background-color:#fff; border: 5px solid #ccc; border-radius: 10px; padding: 20px 50px; display: inline-block; text-align: center; z-index: 10001; user-select: none; box-shadow:5px 15px 10px '+shadowcolor+';',
210				html: '<div style="display:inline-block;text-align:left;">'+msg+'</div><br><div style="text-align:center;padding-top:20px;"><input type="button" id="light-dialog-panel-ok" value="'+okbtn+'"></div>',
211				id: 'light-dialog-panel'
212			}).appendTo('body');
213
214			var R = $("#light-dialog-panel").getPos();
215
216			$("#light-dialog-panel")
217			.css({'top': (R.top+10)+'px','left': R.left+'px'})
218			.animate({'opacity':'1.0','top':R.top+'px'},300,function(){});
219
220			$("#light-dialog-panel").on("click","#light-dialog-panel-ok",function(){
221				$("#light-dialog-panel").animate({'opacity':'0.0','top':(R.top-20)+'px'},500,function(){
222					$("#light-dialog-panel").remove();
223					$("#white-back").remove();
224					callback();
225					callback_ok();
226				});
227			});
228		}
229	}
230
231	function setBack(col){
232		var bgcolor = col || "#fff";
233		$('<div/>',{
234			style: "position:fixed; top:0; left:0; width:100%; height:100%; background-color:"+bgcolor+"; opacity:0.8; z-index:10000;",
235			id: 'white-back'
236		}).appendTo('body');
237	}
238
239	$.fn.getPos = function(){
240		var WinX = $(window).width();
241		var WinY = $(window).height();
242		this.top = ((WinY/2)-(this.outerHeight() /2));
243		this.left = ((WinX/2)-(this.outerWidth()/2));
244		return this;
245	}
246
247})(jQuery);

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.