PageSourceSearch

https://mitaka-yaku.jp/_themes/js/common.js

js mitaka-yaku.jp collected 2026-10-05 11:12:01 UTC 6,103 bytes, 195 lines download raw bytes

1$(document).ready(function(){
2// Block Skip
3  $("#nocssread a").focus(function(){
4    $(this).addClass("show");
5  });
6  $("#nocssread a").blur(function(){
7    $(this).removeClass("show");
8  });
9
10// External Icon
11  $("a[href^='http']").not("[href^='http://"+location.host+"'],[href^='https://"+location.host+"'],[href^='http://http://city.sitebridge.jp/']").append("<img src='/_themes/base/images/ic-blank.gif' alt='新しいウィンドウで外部サイトを開きます' class='external' />").attr("target","_blank");
12  $("a img + img.external").remove();
13
14// Roll Over
15  $("a img").hover(function(){
16    $(this).attr("src", $(this).attr("src").replace("_off", "_on"));
17  },function(){
18    if (!$(this).parent("a").hasClass("cur")){
19      $(this).attr("src", $(this).attr("src").replace("_on", "_off"));
20    }
21  });
22
23// smart toggle menu
24  spMenuFunc(".slideMenu > div");
25
26// ad-banner
27  altToTitleFunc("#bnAdvertisement ul li a");
28  altToTitleFunc("#bnAdvertisementSide ul li a");
29
30// bxslider
31  if($("#keyvisual ul")[0]){
32    $("#keyvisual ul").bxSlider({
33      auto: true,
34      speed: 1500,
35      pause: 10000,
36      autoControls: true
37    });
38  }
39
40// naviRollover
41  naviRollOverFunc("#globalNavi");
42  naviRollOverFunc("#sideMenu");
43  naviRollOverFunc("#sideNavi");
44  naviRollOverFunc("#eventType");
45  $("ul li a[href*='#']").removeClass("cur");  // hash
46
47// heightLine
48  adjacentHeightLineFunc(".contentGpCategoryCategoryTypes .bunya > ul > li", 3);  // categoryTypes
49// simple tabs
50  if($("#simple_tabs")[0]){
51    enable_simple_tabs();
52  }
53/*
54  // category link
55  $("#category section a, .contentGpCategoryCategoryType a, .contentGpCategory section a, #categoryList .pieceBody a, #lifeeventList .pieceBody a").each(function(){
56    var url = null;
57    var url = $(this).attr("href").replace(/\/$/g,'/rank.html');
58    $(this).attr("href",url);
59  });
60  // breadCrumbs link more
61  $("#breadCrumbs a[href^='/faq/bunya/']").each(function(){
62    if($(this).attr("href") != "/faq/bunya/"){
63      var url = null;
64      var url = $(this).attr("href").replace(/\/$/g,'/rank.html');
65      $(this).attr("href",url);
66    }
67  });
68  $("#breadCrumbs a[href^='/faq/lifeevent/']").each(function(){
69    if($(this).attr("href") != "/faq/lifeevent/"){
70      var url = null;
71      var url = $(this).attr("href").replace(/\/$/g,'/rank.html');
72      $(this).attr("href",url);
73    }
74  });
75*/
76
77  // ...
78  if($(".contentGpCategoryCategory .docs li .body")[0]){
79    $(".contentGpCategoryCategory .docs li .body").each(function(){
80      var str = "";
81      var str = $(this).text().replace(/...$/g,'・・・');
82      $(this).text(str);
83    });
84  }
85  // category class
86  $("#breadCrumbs .pieceBody > div").each(function(){
87    var category = null;
88    var category = $(this).children("a:last-child").attr("href").split("/");
89    $("#container").addClass(category[category.length-2]);
90  });
91
92// event tracking
93  $("a.iconFile").click(function(e){
94    var title = $(this).text().replace(/\[.+\]/g,'');
95    ga('send', 'event', '添付ファイル', 'クリック', title);
96  });
97
98});
99
100// adjacent heightLine
101// adjacentHeightLineFunc(".contentGpCategoryCategoryTypes section > ul > li", 3)
102function adjacentHeightLineFunc(element,column){
103  if($(element)[0]){
104    var sets = [], temp = [];
105    $(element).each(function(i){    // make up a party
106      temp.push(this);
107      if(i % column == (column - 1)){
108        sets.push(temp);
109        temp = [];
110      }
111    });
112    if (temp.length) sets.push(temp);
113    $.each(sets, function(){    // set heightLine for party
114      $(this).heightLine({minWidth:600, fontSizeCheck:true});
115    });
116    $("#accessibilityTool .fontSize a").click(function(){    // heightLine initialize
117      $(element).heightLine("refresh");
118    });
119  }
120}
121
122// smart toggle menu
123// spMenuFunc("#sideMenu")
124function spMenuFunc(element){
125  var agent = navigator.userAgent;
126  if((agent.search(/iPhone/) != -1) || (agent.search(/iPad/) != -1) || (agent.search(/Android/) != -1)){
127    if($(element)[0]){
128      if($(element).find(".pieceHeader")[0]){
129        $(element).find(".pieceHeader").children("h2").wrapInner('<a href="javascript:void(0);"></a>');
130        $(element).find(".pieceBody").hide();
131        $(element).find(".pieceHeader").on('click','a',function(){
132          $(this).closest("div").toggleClass("open");
133          $(this).closest("div").next("div").slideToggle();
134        });
135      } else if($(element).find(".smartTitle")[0]){
136        $(element).find(".pieceBody").hide();
137        $(element).find(".smartTitle").on('click','a',function(){
138          $(this).closest("div").toggleClass("open");
139          $(this).closest("div").next("div").slideToggle();
140        });
141      }
142    }
143  }
144}
145
146// img set alt title
147// altToTitleFunc("#bnAdvertisement ul li a")
148function altToTitleFunc(element){
149  if($(element)[0]){
150    $(element).each(function(){
151      $(this).children("img").attr("title", ($(this).children("img").attr("alt")));
152    });
153  }
154}
155
156// preload
157// preloadFunc("01.png", "02.png", "03.png", … )
158function preloadFunc(){
159  for(var i = 0; i< arguments.length; i++){
160    $("<img>").attr("src", arguments[i]);
161  }
162}
163
164// naviRollOver
165// naviRollOverFunc("#globalNavi")
166function naviRollOverFunc(element,setTag){
167  if($(element)[0]){
168    var curTag = setTag || "ul li a";
169    $(element).naviRollOver({
170      type: 'html',
171      firstStrictCheck: false,
172      tag: curTag
173    });
174  }
175}
176
177$(window).on('load',function(){
178  $("#gsearchbox").show();  // search
179});
180
181function enable_simple_tabs() {
182  var simple_tabs = $('#simple_tabs > li');
183  var simple_tab_panels = $('#simple_tab_panels > div');
184
185  var index;
186  simple_tabs.on('click', function () {
187    if (index != simple_tabs.index(this)) {
188      index = simple_tabs.index(this);
189      simple_tab_panels.hide().eq(index).show();
190      simple_tabs.removeClass('current').eq(index).addClass('current');
191    }
192  });
193
194  $(simple_tabs[0]).trigger('click');
195}

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.