PageSourceSearch

https://www.y-mainichi.co.jp/js/custom.js

js y-mainichi.co.jp collected 2026-10-02 07:40:45 UTC 9,312 bytes, 239 lines download raw bytes

1/*********************************************************************
2
3 nemaoffice.com (2013/6/27)
4
5*********************************************************************/
6/************************************************************
7メニュー固定
8 ***********************************************************/
9$(function(){
10    var box    = $("#menu");
11    var boxTop = box.offset().top;
12    $(window).scroll(function () {
13        if($(window).scrollTop() >= boxTop) {
14            box.addClass("fixed");
15			$("body").css("margin-top","40px");
16			$("#menu").css("background","#2c3e50");
17        } else {
18            box.removeClass("fixed");
19			$("body").css("margin-top","0px");
20			$("#menu").css("background","#2c3e50");
21        }
22    });
23});
24/************************************************************
25画像オンオフ
26 ***********************************************************/
27$(function() {
28	var images = $("img");
29	for(var i=0; i < images.size(); i++) {
30		if(images.eq(i).attr("src").match("_off.")) {
31			$("img").eq(i).hover(function() {
32				$(this).attr('src', $(this).attr("src").replace("_off.", "_on."));
33			}, function() {
34				$(this).attr('src', $(this).attr("src").replace("_on.", "_off."));
35			});
36		}
37	}
38});
39
40/************************************************************
41検索
42 ** 		onFocus="clearInput('search', 'Search')" 
43 ** 		onBlur="clearInput('search', 'Search')" />
44 ***********************************************************/
45function clearInput(field_id, term_to_clear) {
46	
47	// Clear input if it matches default value
48	if (document.getElementById(field_id).value == term_to_clear ) {
49		document.getElementById(field_id).value = '';
50	}
51	
52	// If the value is blank, then put back term
53	else if (document.getElementById(field_id).value == '' ) {
54		document.getElementById(field_id).value = term_to_clear;
55	}
56} // end clearSearch()
57/************************************************************
58USTREAM配信
59 ***********************************************************/
60function ustream(status) {
61    if (status == "live") {
62    document.write('<div class="utility2"><div class="content"><iframe width="300" height="201" src="https://www.ustream.tv/embed/14917689" scrolling="no" frameborder="0" style="border: 0px none transparent;margin-top:5px;"></iframe><span style="padding: 2px 0px 2px; width: 290px; display: block; color: #000000; font-weight: normal; font-size: 11px;text-decoration: none; text-align: right;"> <a href="/page/video">過去のライブ配信</a>|<a href="/page/ustream">拡大で見る</a></span></div></div>');
63    } else {
64    document.write('');
65    }
66}
67/************************************************************
68文字サイズ変更
69 ***********************************************************/
70
71$(function(){
72   var target = $('div.contents_tab ul,div.utility ul li,div.utility dl,p,span.tiles_title','#container');          // フォントサイズ変更エリア
73   var controler = $('#font li');   // フォントサイズ変更ボタン(画像あるいはテキストを設定)
74   var fontSize = [100,116,125];         // フォントサイズ(単位は%、HTMLと同じ並び順)
75   var hoverSuffix = '';          // ボバー用画像の接尾辞名(ボバー用画像を使用しない場合は値を空にする)
76   var activeSuffix = '';     // アクティブ用画像の接尾辞名(アクティブ用画像を使用しない場合は値を空にする)
77   var hoverClass = 'hover';         // フォントサイズ変更ボタンのボバー時のクラス名(ボバー時のクラスを使用しない場合は値を空にする)
78   var activeClass = 'active';       // フォントサイズ変更ボタンのアクティブ時のクラス名(アクティブ時のクラスを使用しない場合は値を空にする)
79   var defaultFont = 0;              // 初期フォントサイズ設定(HTMLと同じ並び順で0から設定)
80   var cookieExpires = 7;            // クッキー保存期間
81   var number = fontSize.length;     // フォントサイズ変更ボタンの数
82   var hoverImg = hoverSuffix!='' && controler.is('[src]');
83   var activeImg = activeSuffix!='' && controler.is('[src]');
84
85   // クッキー設定
86   function cookieSet(index){
87      $.cookie('fontsize',fontSize[index],{path:'/',expires:cookieExpires});
88   }
89
90   // 現在フォントサイズ取得
91   function nowFont(){
92      return $.cookie('fontsize');
93   }
94
95   // フォントサイズ設定
96   function changeFont(){
97      target.css({'font-size':nowFont()+'%'});
98   }
99
100   // ボタン画像ハイライトオン
101   function imgOn(btn,suffix) {
102      btn.attr('src',btn.attr('src').replace(eval('/^(\.+)(\\.[a-z]+)$/'),'$1'+suffix+'$2')).css('cursor','pointer');
103   }
104
105   // ボタン画像ハイライトオフ
106   function imgOff(btn,suffix) {
107      btn.attr('src',btn.attr('src').replace(eval('/^(\.+)'+suffix+'(\\.[a-z]+)$/'),'$1$2')).css('cursor','pointer');
108   }
109
110   // 初期表示
111   // フォントサイズがクッキーに保存されている場合
112   if(nowFont()){
113      for(var i=0; i<number; i++){
114         if(nowFont()==fontSize[i]){
115            // 初期ボタン設定
116            var btn = controler.eq(i);
117            // フォントサイズ設定
118            changeFont();
119            // アクティブ用の画像がある場合は表示
120            if(activeImg){
121               imgOn(btn,activeSuffix);
122            }
123             // アクティブ時のクラス名を設定
124            btn.addClass(activeClass);
125         }
126      }
127   }
128   // フォントサイズがクッキーに保存されていない場合
129   else {
130      // 初期ボタン設定
131      var btn = controler.eq(defaultFont);
132      // デフォルトのフォントサイズをクッキーに保存する
133      cookieSet(defaultFont);
134      // フォントサイズ設定
135      changeFont();
136      // アクティブ用の画像がある場合は表示
137      if(activeImg){
138         imgOn(btn,activeSuffix);
139      }
140       // アクティブ時のクラス名を設定
141      btn.addClass(activeClass);
142   }
143
144   // ホバーイベント
145   controler.each(function(i){
146      // 現在のボタン要素を取得
147      var self = $(this);
148      if(hoverImg){
149         self.hover(
150         function(){
151            if(nowFont()!=fontSize[i]){
152               // ホバー用画像に切り替え
153               imgOn(self,hoverSuffix);
154               return;
155            }
156         },
157         function(){
158            if(nowFont()!=fontSize[i]){
159               // 通常用画像に切り替え
160               imgOff(self,hoverSuffix);
161            }
162         });
163      }
164      self.hover(
165      function(){
166         if(nowFont()!=fontSize[i]){
167            // ホバーしたボタンにホバー時のクラス名を設定
168            self.addClass(hoverClass);
169         }
170      },
171      function(){
172         if(nowFont()!=fontSize[i]){
173            // ホバーしたボタンのホバー時のクラス名を削除
174            self.removeClass(hoverClass);
175         }
176      });
177   });
178
179   // クリックイベント
180   controler.click(function(){
181      // 現在のボタン要素を取得
182      var self = $(this);
183      // 現在のボタン要素のインデックス番号(ボタンID)を取得
184      var index = controler.index(self);
185      // フォントサイズをクッキーに保存する
186      cookieSet(index);
187      // フォントサイズ設定
188      changeFont();
189      if(hoverImg){
190         // ホバー用画像をオフ
191         imgOff(self,hoverSuffix);
192      }
193      if(activeImg){
194         // アクティブ用画像に切り替え
195         imgOn(self,activeSuffix);
196         // 非設定画像のアクティブ用画像を通常用に切り替え
197         for(var i=0; i<number; i++){
198            if(nowFont()!=fontSize[i]){
199               imgOff(controler.eq(i),activeSuffix);
200            }
201         }
202      }
203      // クリックしたボタンのホバー時のクラス名を削除
204      self.removeClass(hoverClass);
205      // クリックしたボタンにアクティブ時のクラス名を設定
206      self.addClass(activeClass);
207      // 非設定ボタンのアクティブ時のクラス名を削除
208      controler.not(self).removeClass(activeClass);
209   });
210});
211/************************************************************
212画像リンク
213 ***********************************************************/
214$(document).ready(
215  function(){
216    $("a img") .hover(function(){
217       $(this).fadeTo("4000",0.8);
218    },function(){
219       $(this).fadeTo("4000",1.0);
220    });
221  });
222/************************************************************
223スクロール
224 ***********************************************************/
225$(function() {
226	$(window).scroll(function () {
227		var s = $(this).scrollTop();
228		var m = 1200;
229		if(s > m) {
230			$("#pagetop").fadeIn('slow');
231		} else if(s < m) {
232			$("#pagetop").fadeOut('slow');
233		}
234	});
235	$("#pagetop").click(function () {
236		$('html,body').animate({ scrollTop: 0 }, 'fast');
237		return false;
238	});
239});

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.