PageSourceSearch

https://www.rengo-tokyo.gr.jp/js/common.js

js rengo-tokyo.gr.jp collected 2026-10-04 23:53:09 UTC 11,539 bytes, 485 lines download raw bytes

1// マウスオーバーフェード_オンオフ
2 
3new function(){
4  function setRollOver2(){
5    if(!document.images){return;}
6    var imgs = document.images;
7    var insert = [];
8    for(var i=0;i<imgs.length;i++){
9      var splitname = imgs[i].src.split('_off.');
10      if((splitname[1])&&(imgs[i].parentNode.tagName=='A')){
11        var rolloverImg = document.createElement('img');
12        rolloverImg.src = splitname[0]+'_on.'+splitname[1];
13        var alpha = 0;
14        rolloverImg.currentAlpha = alpha;
15        rolloverImg.style.opacity = alpha/100;
16        rolloverImg.style.filter = 'alpha(opacity='+alpha+')';
17        rolloverImg.style.position = 'absolute';
18 
19        addEvent(rolloverImg,'mouseover',function(){setFader(this,100);});
20        addEvent(rolloverImg,'mouseout',function(){setFader(this,0);});
21 
22        insert[insert.length] = {position:imgs[i],element:rolloverImg};
23      }
24    }
25    for(var i=0;i<insert.length;i++){
26      var parent = insert[i].position.parentNode;
27      parent.insertBefore(insert[i].element,insert[i].position);
28    }
29  }
30 
31  function setFader(targetObj,targetAlpha){
32    targetObj.targetAlpha = targetAlpha;
33    if(targetObj.currentAlpha==undefined){
34      targetObj.currentAlpha = 100;
35    }
36    if(targetObj.currentAlpha==targetObj.targetAlpha){
37      return;
38    }
39    if(!targetObj.fading){
40      if(!targetObj.fader){
41        targetObj.fader = fader;
42      }
43      targetObj.fading = true;
44      targetObj.fader();
45    }
46  }
47 
48  function fader(){
49    this.currentAlpha += (this.targetAlpha - this.currentAlpha)*0.2;
50    if(Math.abs(this.currentAlpha-this.targetAlpha)<1){
51      this.currentAlpha = this.targetAlpha;
52      this.fading = false;
53    }
54    var alpha = parseInt(this.currentAlpha);
55    this.style.opacity = alpha/100;
56    this.style.filter = 'alpha(opacity='+alpha+')';
57    if(this.fading){
58      var scope = this;
59      setTimeout(function(){fader.apply(scope)},30);
60    }
61  }
62 
63  function addEvent(eventTarget, eventName, func){
64    if(eventTarget.addEventListener){
65      eventTarget.addEventListener(eventName, func, false);
66    }else if(window.attachEvent){
67      // IE
68      eventTarget.attachEvent('on'+eventName, function(){func.apply(eventTarget);});
69    }
70  }
71 
72  addEvent(window,'load',setRollOver2);
73 
74}
75
76
77// ページ内リンクをスムーズスクロール
78      $(function(){
79        // #で始まるリンクをクリックしたら実行されます
80        $('a[href^="#"]').click(function() {
81          // スクロールの速度
82          var speed = 500; // ミリ秒で記述
83          var href= $(this).attr("href");
84          var target = $(href == "#" || href == "" ? 'html' : href);
85          var position = target.offset().top;
86          $('body,html').animate({scrollTop:position}, speed, 'swing');
87          return false;
88        });
89      });
90
91
92// トップへスムーススクロール
93$(document).ready(function(){
94 
95    $(".gotop").hide();
96     // ↑ページトップボタンを非表示にする
97 
98    $(window).on("scroll", function() {
99 
100        if ($(this).scrollTop() > 124) {
101            // ↑ スクロール位置が100よりも小さい場合に以下の処理をする
102            $('.gotop').fadeIn("fast");
103            // ↑ (100より小さい時は)ページトップボタンをスライドダウン
104        } else {
105            $('.gotop').fadeOut("fast");
106            // ↑ それ以外の場合の場合はスライドアップする。
107        }
108         
109    // フッター固定する
110 
111        scrollHeight = $(document).height(); 
112        // ドキュメントの高さ
113        scrollPosition = $(window).height() + $(window).scrollTop(); 
114        // ウィンドウの高さ+スクロールした高さ→ 現在のトップからの位置
115        footHeight = $("footer").innerHeight();
116        // フッターの高さ
117                 
118        if ( scrollHeight - scrollPosition  <= footHeight ) {
119        // 現在の下から位置が、フッターの高さの位置にはいったら
120        //  ".gotop"のpositionをabsoluteに変更し、フッターの高さの位置にする        
121            $(".gotop").css({
122                "position":"fixed",
123                "bottom": "40px"
124            });
125        } else {
126        // それ以外の場合は元のcssスタイルを指定
127            $(".gotop").css({
128                "position":"fixed",
129                "bottom": "40px"
130            });
131        }
132    });
133 
134    // トップへスムーススクロール
135    $('.gotop a').click(function () {
136        $('body,html').animate({
137        scrollTop: 0
138        }, 800);
139        // ページのトップへ 500 のスピードでスクロールする
140        return false;
141     });
142 
143});
144
145
146
147// 開閉タブスライダー
148
149$(function(){
150	$("#open1").click(function(){
151		$("#open1").css("display", "none");
152		$("#nenlist1").slideToggle("fast")
153	;})
154;});
155
156$(function(){
157	$("#close1").click(function(){
158		$("#open1").css("display", "block");
159		$("#nenlist1").slideToggle("fast")
160	;})
161;});
162
163$(function(){
164	$("#open2").click(function(){
165		$("#open2").css("display", "none");
166		$("#nenlist2").slideToggle("fast")
167	;})
168;});
169
170$(function(){
171	$("#close2").click(function(){
172		$("#open2").css("display", "block");
173		$("#nenlist2").slideToggle("fast")
174	;})
175;});
176
177$(function(){
178	$("#open3").click(function(){
179		$("#open3").css("display", "none");
180		$("#nenlist3").slideToggle("fast")
181	;})
182;});
183
184$(function(){
185	$("#close3").click(function(){
186		$("#open3").css("display", "block");
187		$("#nenlist3").slideToggle("fast")
188	;})
189;});
190
191$(function(){
192	$("#open4").click(function(){
193		$("#open4").css("display", "none");
194		$("#nenlist4").slideToggle("fast")
195	;})
196;});
197
198$(function(){
199	$("#close4").click(function(){
200		$("#open4").css("display", "block");
201		$("#nenlist4").slideToggle("fast")
202	;})
203;});
204
205$(function(){
206	$("#open5").click(function(){
207		$("#open5").css("display", "none");
208		$("#nenlist5").slideToggle("fast")
209	;})
210;});
211
212$(function(){
213	$("#close5").click(function(){
214		$("#open5").css("display", "block");
215		$("#nenlist5").slideToggle("fast")
216	;})
217;});
218
219$(function(){
220	$("#open6").click(function(){
221		$("#open6").css("display", "none");
222		$("#nenlist6").slideToggle("fast")
223	;})
224;});
225
226$(function(){
227	$("#close6").click(function(){
228		$("#open6").css("display", "block");
229		$("#nenlist6").slideToggle("fast")
230	;})
231;});
232
233$(function(){
234	$("#open7").click(function(){
235		$("#open7").css("display", "none");
236		$("#nenlist7").slideToggle("fast")
237	;})
238;});
239$(function(){
240	$("#close7").click(function(){
241		$("#open7").css("display", "block");
242		$("#nenlist7").slideToggle("fast")
243	;})
244;});
245
246$(function(){
247	$("#open8").click(function(){
248		$("#open8").css("display", "none");
249		$("#nenlist8").slideToggle("fast")
250	;})
251;});
252$(function(){
253	$("#close8").click(function(){
254		$("#open8").css("display", "block");
255		$("#nenlist8").slideToggle("fast")
256	;})
257;});
258
259$(function(){
260	$("#open9").click(function(){
261		$("#open9").css("display", "none");
262		$("#nenlist9").slideToggle("fast")
263	;})
264;});
265$(function(){
266	$("#close9").click(function(){
267		$("#open9").css("display", "block");
268		$("#nenlist9").slideToggle("fast")
269	;})
270;});
271
272$(function(){
273	$("#open10").click(function(){
274		$("#open10").css("display", "none");
275		$("#nenlist10").slideToggle("fast")
276	;})
277;});
278$(function(){
279	$("#close10").click(function(){
280		$("#open10").css("display", "block");
281		$("#nenlist10").slideToggle("fast")
282	;})
283;});
284
285$(function(){
286	$("#open11").click(function(){
287		$("#open11").css("display", "none");
288		$("#nenlist11").slideToggle("fast")
289	;})
290;});
291$(function(){
292	$("#close11").click(function(){
293		$("#open11").css("display", "block");
294		$("#nenlist11").slideToggle("fast")
295	;})
296;});
297
298$(function(){
299	$("#open12").click(function(){
300		$("#open12").css("display", "none");
301		$("#nenlist12").slideToggle("fast")
302	;})
303;});
304$(function(){
305	$("#close12").click(function(){
306		$("#open12").css("display", "block");
307		$("#nenlist12").slideToggle("fast")
308	;})
309;});
310
311$(function(){
312	$("#open13").click(function(){
313		$("#open13").css("display", "none");
314		$("#nenlist13").slideToggle("fast")
315	;})
316;});
317$(function(){
318	$("#close13").click(function(){
319		$("#open13").css("display", "block");
320		$("#nenlist13").slideToggle("fast")
321	;})
322;});
323
324$(function(){
325	$("#open14").click(function(){
326		$("#open14").css("display", "none");
327		$("#nenlist14").slideToggle("fast")
328	;})
329;});
330$(function(){
331	$("#close14").click(function(){
332		$("#open14").css("display", "block");
333		$("#nenlist14").slideToggle("fast")
334	;})
335;});
336
337$(function(){
338	$("#open15").click(function(){
339		$("#open15").css("display", "none");
340		$("#nenlist15").slideToggle("fast")
341	;})
342;});
343$(function(){
344	$("#close15").click(function(){
345		$("#open15").css("display", "block");
346		$("#nenlist15").slideToggle("fast")
347	;})
348;});
349
350
351
352
353
354
355
356
357// SP アドレスバーを非表示
358window.addEventListener("load", function() {
359 setTimeout(function() {
360 	scrollBy(0, 1);
361 }, 100);
362}, false);
363
364
365// SP 右上メニュー の変形アニーメーション
366$(function() {
367  $('.menu-trigger').on('click', function() {
368    $(this).toggleClass('active');
369    return false;
370  });
371});
372
373
374// SP 右上メニュー
375$(function(){
376  $(".menu1").css("display","none");
377  $(".button-toggle1").on("click", function() {
378    $(".menu1").slideToggle();
379    $(this).toggleClass("active1");
380  });
381});
382
383// 子開閉メニュー2
384$(function(){
385  $(".button-toggle2").on("click", function() {
386    $(".menu2").slideToggle();
387    $(this).toggleClass("active2");
388  });
389});
390
391// 子開閉メニュー3
392$(function(){
393  $(".button-toggle3").on("click", function() {
394    $(".menu3").slideToggle();
395    $(this).toggleClass("active3");
396  });
397});
398
399// 子開閉メニュー4
400$(function(){
401  $(".button-toggle4").on("click", function() {
402    $(".menu4").slideToggle();
403    $(this).toggleClass("active4");
404  });
405});
406
407// 子開閉メニュー5
408$(function(){
409  $(".button-toggle5").on("click", function() {
410    $(".menu5").slideToggle();
411    $(this).toggleClass("active5");
412  });
413});
414
415// 子開閉メニュー6
416$(function(){
417  $(".button-toggle6").on("click", function() {
418    $(".menu6").slideToggle();
419    $(this).toggleClass("active6");
420  });
421});
422
423// 子開閉メニュー7
424$(function(){
425  $(".button-toggle7").on("click", function() {
426    $(".menu7").slideToggle();
427    $(this).toggleClass("active7");
428  });
429});
430
431// 子開閉メニュー8
432$(function(){
433  $(".button-toggle8").on("click", function() {
434    $(".menu8").slideToggle();
435    $(this).toggleClass("active8");
436  });
437});
438
439// 子開閉メニュー9
440$(function(){
441  $(".button-toggle9").on("click", function() {
442    $(".menu9").slideToggle();
443    $(this).toggleClass("active9");
444  });
445});
446
447// 子開閉メニュー10
448$(function(){
449  $(".button-toggle10").on("click", function() {
450    $(".menu10").slideToggle();
451    $(this).toggleClass("active10");
452  });
453});
454
455
456
457// ニュース一覧用開閉メニュー1
458$(function(){
459  $(".button-toggle11").on("click", function() {
460    $(".menu11").slideToggle();
461    $(this).toggleClass("active11");
462  });
463});
464
465// ニュース一覧用開閉メニュー1
466$(function(){
467  $(".button-toggle12").on("click", function() {
468    $(".menu12").slideToggle();
469    $(this).toggleClass("active12");
470  });
471});
472
473
474// メガメニューがスクロールで消えるスクリプト 80ピクセル下スクロールで消える
475$(function() {
476    var topMenu = $('.megamenu');    
477    topMenu.hide();
478    $(this).scroll(function () {
479        if ($(this).scrollTop() > 80) {
480            topMenu.fadeOut();
481        } else {
482            topMenu.fadeIn();
483        }
484    });
485});

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.