PageSourceSearch

https://www.nagoyacrown.co.jp/js/common.js

js nagoyacrown.co.jp collected 2026-10-05 05:40:40 UTC 4,643 bytes, 192 lines download raw bytes

1//共通javascript
2
3// 半透明ホバー
4$(document).ready(function() {
5	$("a").not(".not_opacity").children("img")
6	.hover(
7		function(){
8			$(this).stop();
9			$(this).fadeTo(300, 0.60);
10		},
11		function(){
12			$(this).stop();
13			$(this).fadeTo(300, 1.0);
14		}
15	);
16	$(".over").hover(
17		function(){
18			$(this).stop();
19			$(this).fadeTo(300, 0.60);
20		},
21		function(){
22			$(this).stop();
23			$(this).fadeTo(300, 1.0);
24		}
25	);
26});
27
28// ScrollTo
29function scrollToElement(selector, time, verticalOffset) {
30	time = typeof(time) != 'undefined' ? time : 500;
31	var fixnavH = $(".con_nav.fixed").height();
32	verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : 0;
33	element = $(selector);
34	offset = element.offset();
35	offsetTop = offset.top + verticalOffset - fixnavH - 10;
36	$('html, body').animate({
37		scrollTop: offsetTop
38	}, time);
39}
40
41$(document).ready(function() {
42	$('a.scroll').click(function(e){
43		e.preventDefault();
44		scrollToElement($(this).attr('href'));}
45	);
46});
47
48/* アンカーの位置をfixmenu分ずらす */
49$(function(){
50	$(window).on('load',function(){
51		var hash = "#" + location.hash.replace(/[^\w]/g, ""); //XSS対策
52		var fixnavH = $(".con_nav").height() + 10;
53		if($(hash).size()){
54			$('html,body').scrollTop($(hash).offset().top - fixnavH);
55		}
56	});
57});
58
59//スクロールするとヘッダーに固定表示
60function fixmenu() {
61	var nav = $('.con_nav.fixmenu');
62	var basenav = $('#header .con_nav');
63	//表示位置
64	var navTop = basenav.offset().top;
65	var navHeight = nav.outerHeight();
66	var showFlug = false;
67	nav.css('top', -navHeight+'px');
68	$(window).scroll(function () {
69		var winTop = $(this).scrollTop();
70		if (winTop >= navTop) {
71			if (showFlug == false) {
72				showFlug = true;
73				nav
74					.addClass('fixed')
75					.show()
76					.stop().animate({'top' : '0px'}, 200);
77			}
78		} else if (winTop <= navTop) {
79			if (showFlug) {
80				showFlug = false;
81				nav.stop().animate({'top' : -navHeight+'px'}, 200, function(){
82					nav.removeClass('fixed').hide();
83				});
84			}
85		}
86	});
87}
88
89$(window).on('load resize', function() {
90	fixmenu();
91});
92
93//spmenu
94$(document).ready(function() {
95	$(".con_spmenu .btn_menu a").on('click',function(e){
96		e.preventDefault();
97		$("#gnav_sp").slideDown();
98		$(".overlay").show();
99		$("body").css("position","relative");
100	});
101	$("#gnav_sp .btn_close a").on('click',function(e){
102		e.preventDefault();
103		$("#gnav_sp").slideUp();
104		$(".overlay").hide();
105		$("body").css("position","");
106	});
107});
108
109  /* PC版 オーバーレイを外す スマホ版 オーバーレイ表示 */
110$(window).resize(function() {
111	var w = window.innerWidth;
112	var x = 768;
113	if (w >= x && $("#gnav_sp").css("display")=="block") {
114		$(".overlay").hide();
115	} else if (w <= x && $("#gnav_sp").css("display")=="block") {
116		$(".overlay").show();
117	}
118});
119
120(function(){
121
122	/**
123	 * スムーズスクロールプラグイン
124	 */
125	$.fn.scroller = function( options ) {
126		var settings_scroll = $.extend({}, $.fn.scroll.defaults, options);
127		var obj_scroll = $(this);
128		var userAgent = window.navigator.userAgent.toLowerCase();
129		var webkit = userAgent.indexOf("safari") > -1;
130		var firefox = userAgent.indexOf("firefox") > -1;
131		var ie = false;
132		if (/*@cc_on!@*/false) {
133			ie = true;
134			if (navigator.userAgent.match(/MSIE (\d\.\d+)/)) {ieV = parseFloat(RegExp.$1);}
135		}
136		$('a.'+settings_scroll.scroll_class+'[href^=#]').click(function(){
137			var target = $(this).attr("href");
138			var target_size = $(target).offset().top;
139			var targetTemp = String(target_size).split(".");
140			 target_size = targetTemp[0];
141			if(target.indexOf(settings_scroll.no_scroll_anker_size_class) == -1){
142				target_size = Number(target_size) + Number(settings_scroll.scroll_size);
143			}
144			if(settings_scroll.scroll_flg == 1){
145				if(ie){
146					$('html').animate({
147						scrollTop: target_size
148						},400,'swing'
149					);
150				}
151				if(webkit){
152					$('body').animate({
153						scrollTop: target_size
154						},400,'swing'
155					);
156				}
157				if(firefox){
158					$('html').animate({
159						scrollTop: target_size
160						},400,'swing'
161					);
162				}
163			}
164		});
165	}
166
167	// スクロール初期設定
168	$.fn.scroll.defaults = {
169		scroll_class: 'scroll',	// スクロールさせるクラス
170		scroll_flg: 1,	// スクロール_1:する、2:しない
171		scroll_size:100,
172		no_scroll_anker_size_class:'' //ずらすアンカー名
173	};
174})(jQuery)
175
176// Scroll to Top Animated
177$(document).ready(function(){
178
179	// hide #back-top first
180	$("#pagetop").hide();
181	
182	// fade in #back-top
183	$(function () {
184		$(window).scroll(function () {
185			if ($(this).scrollTop() > 300) {
186				$('#pagetop').fadeIn();
187			} else {
188				$('#pagetop').fadeOut();
189			}
190		});
191	});
192});

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.