PageSourceSearch

https://esashi-kankou.com/wp/wp-content/themes/esashiVer2.0/js/toppage.js

js esashi-kankou.com collected 2026-10-04 07:51:29 UTC 4,271 bytes, 176 lines download raw bytes

1// 関数1
2jQuery(function($){
3
4	var check = 0;
5
6	// ファーストビューでフル画面
7	$(function(){
8		var h;
9		$(window).on('load resize', function () {
10		    h = $(window).height();
11		    $("#js-header").css("height", h + "px");
12		});
13	});
14
15	// ウインドウ幅の判定
16	$(window).on('load resize', function() {
17	  var w = window.innerWidth;
18	  var x = 825;
19	  if(w <= x) {
20	    $('#js-main-menu-ul').appendTo('#js-menu_sp');
21			$('#js-header-menu').appendTo('#js-menu_sp');
22			$('#js-sns-menu').appendTo('#js-menu_sp');
23	  }else{
24	    $('#js-main-menu-ul').appendTo('#js-main-menu');
25			$('#js-header-menu').appendTo('#js-wrap_header-menu');
26			$('#js-sns-menu').appendTo('#js-wrap_header-menu');
27	  }
28		$('#js-menu_sp').removeClass('active');
29		$('#js-btn_hamburger').children().removeClass('on');
30		$('#js-btn_hamburger').removeClass('active');
31		$('#js-overlay').hide();
32		check = 0;
33	});
34
35	// ハンバーガーアイコンの開閉の関数
36  $('#js-btn_hamburger, #js-overlay').on('click', function(){
37		var scrollpos = $(window).scrollTop();
38    if(check == 0){
39			$('#js-body').addClass('no-scroll');
40      $('#js-btn_hamburger').children().addClass('on');
41			$('#js-btn_hamburger').addClass('active');
42			$('#js-menu_sp').addClass('active');
43			$('#js-overlay').show();
44      check = 1;
45    } else if(check == 1) {
46			$('#js-body').removeClass('no-scroll');
47      $('#js-btn_hamburger').children().removeClass('on');
48			$('#js-btn_hamburger').removeClass('active');
49      $('#js-menu_sp').removeClass('active');
50			$('#js-overlay').hide();
51      check = 0;
52    }
53  });
54
55	// スムーズスクロール
56	$('a[href^="#"]').click(function() {
57		var speed = 600;
58		var href= $(this).attr("href");
59		var target = $(href == "#" || href == "" ? 'html' : href);
60		var position = target.offset().top;
61		$('body,html').animate({scrollTop:position}, speed, 'swing');
62		return false;
63	});
64
65});
66
67
68// 関数2
69jQuery(function($){
70
71	// スクロールを監視
72		var target = $('#js-main-menu');
73		var target_height = $('#js-main-menu li').height();//メニューの高さ
74		$(window).scroll(function () {
75			target_offset = $(window).height();
76			if($(window).scrollTop() > target_offset) {
77			target.addClass('fixed');
78			var bodyTop = $('body').css('top');
79			target.css('top',bodyTop);
80		}else{
81			target.removeClass('fixed');
82			target.css('top','');
83		}
84		});
85
86});
87
88
89// 関数3
90jQuery(function ($) {
91
92	// ユーザーエージェント判定
93  var ua = navigator.userAgent;
94  if (ua.indexOf('iPhone') > 0 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) {
95      // スマートフォン用コード
96			$('#js-video').css('display', 'none');
97  } else if (ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0) {
98      // タブレット用コード
99			$('#js-video').css('display', 'none');
100  } else {
101      // PC用コード
102      $('.wrap_video').css('background-image', 'none');
103  }
104
105});
106
107
108// 関数4
109jQuery(document).ready(function(){
110
111		// slickのカスタマイズ
112		$('.slider').slick({
113		 centerMode: true,
114			arrows: true,
115		    centerPadding: '17.6%',
116  	slidesToShow: 3,
117			responsive: [{
118					 breakpoint: 1000,
119							settings: {
120									 slidesToShow: 3,
121					 }
122				 },{
123					 breakpoint: 700,
124							settings: {
125									 slidesToShow: 1,
126					 }
127			}]
128		});
129
130		// アニメーション
131		window.sr = ScrollReveal();
132		sr.reveal('.animate',{
133			easing: 'ease',
134			duration: 2000,
135			distance: '50px',
136			opacity: 0.2,
137			scale: 0.9
138		}
139	);
140
141});
142
143
144// 関数5
145jQuery(function($) {
146		 var showFlag = false;
147		 var topBtn = $('#js-page-top');
148		 topBtn.css('bottom', '-100px');
149
150		 $(window).scroll(function(){
151				 if($(this).scrollTop() > 500) {
152						 if(showFlag == false) {
153								 showFlag = true;
154								 topBtn.stop().animate({'bottom':'8px'}, 200);
155						 }
156				 }else{
157						 if(showFlag == true){
158								 showFlag = false;
159								 topBtn.stop().animate({'bottom':'-100px'},200);
160						 }
161				 }
162		 });
163
164		 topBtn.on('click', function(){
165				 $('body, html').animate({
166						 scrollTop: 0
167				 }, 500);
168				 return false;
169		 });
170 });
171
172// jQuery(function($) {
173// 	$('.skiptranslate iframe').on("load",function(){
174// 		$('.skiptranslate iframe').contents().find('.goog-te-banner-content').css("display","none");
175// 	});
176// });

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.