PageSourceSearch

https://www.city.shiroi.chiba.jp/theme/base/js/sub.js

js city.shiroi.chiba.jp collected 2026-10-02 07:51:29 UTC 5,607 bytes, 174 lines download raw bytes

1/**
2 * サブページ専用jsセット
3 */
4
5$(function(){
6
7  // サイド追従設定
8
9  var scale = 1;
10
11  $(window).on('load', function() {
12    setWrapperHeight();
13
14    $('.header-fixed-box').fitSidebar({
15      wrapper: '#wrapper'
16    });
17  });
18
19	//文字サイズ変更監視 ボックスの高さを揃える
20	$.fn.fontSizeChange({func:function(){
21		$(".level1col2").eqGroupHeight(2);
22		$(".level2col1 .list").eqGroupHeight(2);
23    $(".level1-gaiyo").eqGroupHeight(2);
24    $(".level1col2-gaiyo .col").eqGroupHeight(2);
25
26    $(".level2col2 .box2 .list").eqGroupHeight(2);
27
28    //混在用
29    $(".level2col1-mixed .list").eqGroupHeight(2);
30    $(".level2col2-mixed .col").eqGroupHeight(2);
31    $(".level2col2-mixed .box2 .list").eqGroupHeight(2);
32    $(".level2col2-mixed-js .col").eqGroupHeight(2);
33    $(".level2col2-mixed-js .box2 .list").eqGroupHeight(2);
34
35    $(".thumbnail-list-area .list").eqGroupHeight(3);
36
37		$("#wrapper").show();
38	}});
39
40
41	// wysiwygとフリーレイアウトエリア内で使用されるh2,h3,h4などに装飾用要素を追加
42  (function(){
43    //ターゲット要素
44    $target = $('.wysiwyg h2,.wysiwyg h3,.wysiwyg h4,.wysiwyg h5,.wysiwyg h6,.free-layout-area h2,.free-layout-area h3,.free-layout-area h4,.free-layout-area h5,.free-layout-area h6');
45    //装飾用要素
46    $innerElm1 = $('<span class="bg"></span>');
47    $innerElm2 = $('<span class="bg2"></span>');
48    $innerElm3 = $('<span class="bg3"></span>');
49    //ターゲット要素に装飾用要素を内包
50    $target.each(function(){
51      $this = $(this);
52      if($this.find('span').length == 0){
53        $this.wrapInner($innerElm3);
54        $this = $this.wrapInner($innerElm2);
55        $this = $this.wrapInner($innerElm1);
56      }
57    });
58  })();
59
60	//2階層2列(管理画面で並べないモード。ページ優先・カテゴリ優先用)
61	$(".level2col2,.level2col2js").level2Col2();
62
63	//2階層1列
64	$(".level2col1").level2Col1();
65
66	// 左寄せ画像、右寄せ画像の最初の要素は上マージンを持たせない
67	$('.img-text .wysiwyg').each(function() {
68		$(this).find(' > :first').addClass('firstTopCom');
69	});
70
71  //横並び画像
72  $(window).on('load resize',function(){
73    $(".col-area").colImgSetWidth();
74    $(".thumbnail-list-area .list").eqGroupHeight(3);
75  });
76
77  //イベントスライダーの実行
78  $("body").eventSlider();
79
80  //大カテゴリトップスライダー
81  $('#large-category-slider .bxslider .list').bxSlider({
82    auto: true
83    ,autoControls: true
84    ,speed: 1000
85    ,pause: 5000
86    ,slideWidth: 700
87    ,maxSlides: 1
88    ,minSlides: 1
89    ,pager: false
90    ,slideMargin: 0
91  });
92
93  // 印刷ボタン用
94  $('.sub-print').click(function(){
95    window.print();
96  });
97
98  (function(){
99    var newsList = 5;
100    var newsMoreText = '新着情報を更に表示';
101    var newsListSize = $('#contents-large-category .news-area .list li').length;
102
103    if (newsListSize > newsList) {
104      $('#contents-large-category .news-area .in').append('<ul class="more"><li><a href="#">' + newsMoreText + '</a></li></ul>');
105      $('#contents-large-category .news-area .list li:not(:lt(' + newsList + '))').hide();
106
107      $('#contents-large-category .news-area .more li a').click(function(e){
108        e.preventDefault();
109        if ($('#contents-large-category .news-area .list li:eq(' + newsList + ')').is(':hidden')){
110          $('#contents-large-category .news-area .list li:hidden').show();
111          $('#contents-large-category .news-area .more').hide();
112        }
113      });
114    }
115
116  })();
117
118
119  // ドロップメニュー高さ設定
120  function setDropmenuHeight() {
121    $('.header-in').height('');
122    var windowHeight = $(window).height();
123    var headerHeight = $('.header-in').height();
124    if (windowHeight > headerHeight) {
125      $('.dropmenu, .dropmenu > .in > .bg').height(windowHeight);
126      $('.header-in').height(windowHeight);
127    } else {
128      $('.dropmenu, .dropmenu > .in > .bg').height(headerHeight);
129    }
130  }
131
132  // コンテンツ高さ設定
133  function setWrapperHeight() {
134    if (window.innerWidth > 768) {
135      var $wrapper = $('#wrapper');
136      $wrapper.height('');
137      $wrapper.height($wrapper.height() + ($('.wrap-container').height() * (scale - 1)));
138    }
139  }
140
141});
142
143$(window).on('load resize orientationchange',function(){
144
145  function calendarBoxStyleChange(){
146
147    var $calendarTarget = $(".calendar-box-area .calendar-area");
148    var $calendarWeekTarget = $(".calendar-box-area .calendar-area .week-row th");
149
150    var sunW = $calendarWeekTarget.eq(0).width();
151    var monW = $calendarWeekTarget.eq(1).width();
152    var tueW = $calendarWeekTarget.eq(2).width();
153    var wedW = $calendarWeekTarget.eq(3).width();
154    var thuW = $calendarWeekTarget.eq(4).width();
155    var friW = $calendarWeekTarget.eq(5).width();
156    var satW = $calendarWeekTarget.eq(6).width();
157
158    $calendarTarget.css({
159      "background-positionX": (sunW + monW + tueW + wedW + thuW + friW) + "px," + (sunW + monW + tueW + wedW + thuW) + "px," + (sunW + monW + tueW + wedW) + "px," + (sunW + monW + tueW) + "px," + (sunW + monW) + "px," + sunW + "px," + "0px"
160    });
161
162  }
163
164  var $calendarChangeTarget = $(".calendar-list-area .changeCalendarType, .calendar-box-area .calGoCurrentMonth, .calendar-box-area .calGoPrevMonth, .calendar-box-area .calGoNextMonth");
165
166  $calendarChangeTarget.click(function(){
167
168    calendarBoxStyleChange();
169
170  });
171
172  calendarBoxStyleChange();
173
174});

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.