PageSourceSearch

https://www.eaglekenso.com/wp/wp-content/themes/eagle/js/function.js?210226

js eaglekenso.com collected 2026-10-02 06:42:04 UTC 10,675 bytes, 382 lines download raw bytes

1/* PC/tablet/spの振り分け */
2var ua = window.navigator.userAgent.toLowerCase();
3if( ua.indexOf('iphone') > 0 || ua.indexOf('ipod') > 0 || (ua.indexOf('android') > 0 && ua.indexOf('mobile') > 0) || ( ua.indexOf('windows') > 0 && ua.indexOf('phone') > 0) || ( ua.indexOf('firefox') > 0 && ua.indexOf('mobile') > 0) ) {
4$(function(){
5	 $('body').addClass('spContent');
6});	
7} else if( ua.indexOf('ipad') > 0 || ua.indexOf('android') > 0 || (ua.indexOf('windows') > 0 && ua.indexOf('touch') > 0) || ( ua.indexOf('firefox') > 0 && ua.indexOf('tablet') > 0) ) {
8$(function(){
9	 $('body').addClass('tabContent');
10});
11} else if( ua.indexOf('ipad') > -1 || ua.indexOf('macintosh') > -1 && 'ontouchend' in document ) {
12$(function(){
13	 $('body').addClass('tabContent');
14});
15} else {
16$(function(){
17	 $('body').addClass('pcContent');
18});	 
19}
20
21
22/*アニメーション*/
23$(function(){
24var setElm = $('.anime'),
25delayHeight = 50;
26$(window).on('load scroll resize',function(){
27setElm.each(function(){
28var setThis = $(this),
29elmTop = setThis.offset().top,
30elmHeight = setThis.height(),
31scrTop = $(window).scrollTop(),
32winHeight = $(window).height();
33if (scrTop > elmTop - winHeight + delayHeight && scrTop < elmTop + elmHeight){
34setThis.addClass('animation');
35setTimeout(function(){
36setThis.addClass('animationAfter01');
37}, 100);
38setTimeout(function(){
39setThis.addClass('animationAfter02');
40}, 200);
41setTimeout(function(){
42setThis.addClass('animationAfter03');
43}, 500);
44setTimeout(function(){
45setThis.addClass('animationAfter04');
46}, 1000);
47}// 【上】からスクロールしてきた時のイベント
48 else if (scrTop < elmTop - winHeight + delayHeight && scrTop < elmTop + delayHeight){
49setThis.removeClass('animation');
50setThis.removeClass('animationAfter01');
51setThis.removeClass('animationAfter02');
52setThis.removeClass('animationAfter03');
53setThis.removeClass('animationAfter04');
54} // 【下】からスクロールしてきた時のイベント
55 else {
56//  setThis.removeClass('animation');
57// setThis.removeClass('animationAfter01');
58// setThis.removeClass('animationAfter02');
59// setThis.removeClass('animationAfter03');
60// setThis.removeClass('animationAfter04');
61}
62});
63});
64});
65
66
67/*[スマホメニューアコーディオン] */
68$(function () {
69$("div.accordion").after().hide();
70$("a.accordion").click(function () {
71$(this).next().slideToggle();
72});
73$(".close").click(function () {
74$(this).parent().slideToggle();
75});
76});
77/*[スマホメニューアコーディオン開閉ボタン] */
78$(function () {
79$("#panel-btn").click(function () {
80$("#panel").slideToggle(200);
81$("#panel-btn-icon").toggleClass("close");
82$("#panel-btn .note").toggleClass("close");
83return false;
84});
85});
86
87/*ヘッダーアコーディオン*/
88$(function(){
89$("ul.subMenu").hide();
90$("ul.hLink>li.mainMenu").hover(function(){
91$("ul:not(:animated)", this).slideDown(300);},
92function(){$("ul.subMenu",this).slideUp(300);});
93});
94
95/*SPヘッダーアコーディオン*/
96$(function() {
97function contactLink() {
98$(this).next().slideToggle(150);
99$(this).toggleClass('open');
100}
101$(".spNavi .mainNavi .main").click(contactLink);
102});
103
104/*トップスライダー*/
105$(function(){
106$('#fader4').crossFader({
107random: false,
108loop: true,
109clickStep: false
110});
111});
112
113/*ヘッダートップ表示*/
114$(function() {
115var topBtn = $('#fixHeader,a.c_nav-bt');	
116var windowWidth = $(window).width();
117var windowSm = 767;
118if (windowWidth <= windowSm) {
119    //横幅767px以下のとき(つまりスマホ時)に行う処理を書く
120    $(window).scroll(function () {
121    if ($(this).scrollTop() > 60) {
122    topBtn.addClass('fixed');
123    } else {
124    topBtn.removeClass('fixed');
125    }
126    });
127} else {
128    //横幅767px超のとき(タブレット、PC)に行う処理を書く
129    $(window).scroll(function () {
130    if ($(this).scrollTop() > 75) {
131    topBtn.addClass('fixed');
132    } else {
133    topBtn.removeClass('fixed');
134    }
135    });
136}
137});
138
139$(function() {
140var topBtn = $('.tabContent #fixHeader,.tabContent a.c_nav-bt');	
141$(window).scroll(function () {
142if ($(this).scrollTop() > 75) {
143topBtn.addClass('fixed');
144} else {
145topBtn.removeClass('fixed');
146}
147}
147);
148});
149
150
151
152/*ヘッダー表示*/
153$(function() {
154var topBtn = $('.pcContent #fixHeader');	
155topBtn.hide();
156$(window).scroll(function () {
157if ($(this).scrollTop() > 500) {
158topBtn.fadeIn();
159} else {
160topBtn.fadeOut();
161}
162});
163});
164
165
166/*セレクトボタン*/
167$(function(){
168    $(".wpcf7-select").customSelect();
169});
170
171/*アコーディオン*/
172$(function() {
173function spfooter() {
174$(this).next().slideToggle(150);
175$(this).toggleClass('open');
176}
177$(".spContent #footer .fNavi .mainNavi .main").click(spfooter);
178});
179
180/*ポップアップ*/
181jQuery(document).ready(function() {
182$('a.fancybox').fancybox({
183openEffect  : 'none',
184closeEffect : 'none',
185prevEffect : 'none',
186nextEffect : 'none',
187closeBtn  : true,
188helpers : {
189overlay: {
190locked: true 
191},
192title : {
193type : 'outside'
194},
195buttons	: {}
196},
197afterLoad : function() {
198this.title =  (this.title ? '' + this.title : '') +'';
199}
200});
201});
202
203
204
205
206/*文字数制限*/
207jQuery(function($) {
208  $('#news .newsList li .ttl').each(function() {
209    var $target = $(this);
210 
211    // オリジナルの文章を取得する
212    var html = $target.html();
213 
214    // 対象の要素を、高さにautoを指定し非表示で複製する
215    var $clone = $target.clone();
216    $clone
217      .css({
218        display: 'none',
219        position : 'absolute',
220        overflow : 'visible'
221      })
222      .width($target.width())
223      .height('auto');
224 
225    // DOMを一旦追加
226    $target.after($clone);
227 
228    // 指定した高さになるまで、1文字ずつ消去していく
229    while((html.length > 0) && ($clone.height() > $target.height())) {
230      html = html.substr(0, html.length - 1);
231      $clone.html(html + '...');
232    }
233 
234    // 文章を入れ替えて、複製した要素を削除する
235    $target.html($clone.html());
236    $clone.remove();
237  });
238});
239
240/*メニューページアコーディオン*/
241$(function() {
242function demo01() {
243$(this).next().slideToggle(150);
244$(this).toggleClass('open');
245}
246$(".materialContent .ttl").click(demo01);
247});
248$(function() {
249function demo02() {
250$(this).next().slideToggle(150);
251$(this).toggleClass('open');
252}
253$(".faqContent .ttl").click(demo02);
254});
255
256
257
258/*高さ調節*/
259var ua = navigator.userAgent;
260if( ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || (ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) || ( ua.indexOf('windows') > 0 && ua.indexOf('phone') > 0) || ( ua.indexOf('firefox') > 0 && ua.indexOf('mobile') > 0) ) {
261$(function(){
262	 $('.heightAdjust').addClass('');
263});	
264} else if( ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0 || (ua.indexOf('windows') > 0 && ua.indexOf('touch') > 0) || ( ua.indexOf('firefox') > 0 && ua.indexOf('tablet') > 0) ) {
265$(function(){
266	 $('.heightAdjust').addClass('heightLineParent');
267});
268} else {
269$(function(){
270	 $('.heightAdjust').addClass('heightLineParent');
271});	 
272}
273
274/*Heightline*/
275new function(){
276	
277	function heightLine(){
278	
279		this.className="heightLine";
280		this.parentClassName="heightLineParent"
281		reg = new RegExp(this.className+"-([a-zA-Z0-9-_]+)", "i");
282		objCN =new Array();
283		var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
284		for(var i = 0; i < objAll.length; i++) {
285			var eltClass = objAll[i].className.split(/\s+/);
286			for(var j = 0; j < eltClass.length; j++) {
287				if(eltClass[j] == this.className) {
288					if(!objCN["main CN"]) objCN["main CN"] = new Array();
289					objCN["main CN"].push(objAll[i]);
290					break;
291				}else if(eltClass[j] == this.parentClassName){
292					if(!objCN["parent CN"]) objCN["parent CN"] = new Array();
293					objCN["parent CN"].push(objAll[i]);
294					break;
295				}else if(eltClass[j].match(reg)){
296					var OCN = eltClass[j].match(reg)
297					if(!objCN[OCN]) objCN[OCN]=new Array();
298					objCN[OCN].push(objAll[i]);
299					break;
300				}
301			}
302		}
303		
304		//check font size
305		var e = document.createElement("div");
306		var s = document.createTextNode("S");
307		e.appendChild(s);
308		e.style.visibility="hidden"
309		e.style.position="absolute"
310		e.style.top="0"
311		document.body.appendChild(e);
312		var defHeight = e.offsetHeight;
313		
314		changeBoxSize = function(){
315			for(var key in objCN){
316				if (objCN.hasOwnProperty(key)) {
317					//parent type
318					if(key == "parent CN"){
319						for(var i=0 ; i<objCN[key].length ; i++){
320							var max_height=0;
321							var CCN = objCN[key][i].childNodes;
322							for(var j=0 ; j<CCN.length ; j++){
323								if(CCN[j] && CCN[j].nodeType == 1){
324									CCN[j].style.height="auto";
325									max_height = max_height>CCN[j].offsetHeight?max_height:CCN[j].offsetHeight;
326								}
327							}
328							for(var j=0 ; j<CCN.length ; j++){
329								if(CCN[j].style){
330									var stylea = CCN[j].currentStyle || document.defaultView.getComputedStyle(CCN[j], '');
331									var newheight = max_height;
332									if(stylea.paddingTop)newheight -= stylea.paddingTop.replace("px","");
333									if(stylea.paddingBottom)newheight -= stylea.paddingBottom.replace("px","");
334									if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","");
335									if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
336									CCN[j].style.height =newheight+"px";
337								}
338							}
339						}
340					}else{
341						var max_height=0;
342						for(var i=0 ; i<objCN[key].length ; i++){
343							objCN[key][i].style.height="auto";
344							max_height = max_height>objCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight;
345						}
346						for(var i=0 ; i<objCN[key].length ; i++){
347							if(objCN[key][i].style){
348								var stylea = objCN[key][i].currentStyle || document.defaultView.getComputedStyle(objCN[key][i], '');
349									var newheight = max_height;
350									if(stylea.paddingTop)newheight-= stylea.paddingTop.replace("px","");
351									if(stylea.paddingBottom)newheight-= stylea.paddingBottom.replace("px","");
352									if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","")
353									if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
354									objCN[key][i].style.height =newheight+"px";
355							}
356						}
357					}
358				}
359			}
360		}
361		
362		checkBoxSize = function(){
363			if(defHeight != e.offsetHeight){
364				changeBoxSize();
365				defHeight= e.offsetHeight;
366			}
367		}
368		changeBoxSize();
369		setInterval(checkBoxSize,1000)
370		window.onresize=changeBoxSize;
371	}
372	
373	function addEvent(elm,listener,fn){
374		try{
375			elm.addEventListener(listener,fn,false);
376		}catch(e){
377			elm.attachEvent("on"+listener,fn);
378		}
379	}
380	addEvent(window,"load",heightLine);
381}
382

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.