PageSourceSearch

https://www.town.aisho.shiga.jp/theme/base/js/top.js

js town.aisho.shiga.jp collected 2026-10-02 06:32:03 UTC 6,053 bytes, 177 lines download raw bytes

1$(function(){
2
3  // テキストタブ
4  $.fn.textTab({defaultSelect:0,cookie:'topTab2',tabs:$("#top-tab .list li"),pages:$("#top-tab .box")});
5
6  // 広告クリックをカウントする
7  $('.js-kb-click .list a').bannerClick({});
8  
9  // 広告クリックをカウントする(GA4)
10  $('.js-kb-click .list a').bannerClick2({});
11
12
13  //トップスライダー
14  if($('#hero-section .bxslider .list li').length > 1){
15    $('#hero-section .bxslider .list').bxSlider({
16      auto: true
17      ,autoControls: true
18      ,mode: 'fade'
19      ,speed:1000
20      ,pause:5000
21      ,maxSlides: 1
22      ,minSlides: 1
23      ,slideMargin:0
24      ,autoControlsCombine: true
25      ,captions: false
26      ,pager: false
27      ,controls: false
28      ,onSliderLoad:function(currentIndex){
29      }
30    });
31  }
32
33  //トップスライダーのキャプション 36文字以上は...になる
34  var $setElm = $('#town-now-section span');
35  var cutFigure = '25'; // カットする文字数
36  var afterTxt = ' …'; // 文字カット後に表示するテキスト
37
38  $setElm.each(function(){
39    var textLength = $(this).text().length;
40    var textTrim = $(this).text().substr(0,(cutFigure))
41
42    if(cutFigure < textLength) {
43      $(this).html(textTrim + afterTxt).css({visibility:'visible'});
44    } else if(cutFigure >= textLength) {
45      $(this).css({visibility:'visible'});
46    }
47  });
48
49  /**
50   * JAlert
51   * @param ...
52   * @return ... Returns {@ code}
53   */
54  // var renkei_no = 1; //連携設定No
55  // $(".jalert-wrap").jAlertListView({
56  //   // データパス
57  //   rssPath: site_domain + '/cgi-bin/smart_alert.php/' + renkei_no,
58  //   historyClass:'.btn-more',
59  //   historyPath:site_domain + '/cgi-bin/smart_alert.php/' + renkei_no +'/list',  
60  //   listClass:'.list',
61  //   limit:'10', //テンプレート設計書からセット
62  //   html:''
63  // });
64
65if (matchMedia('(max-width: 768px)').matches) {
66
67//スライダー(スマホ側)
68
69 //ピックアップスライダー
70  if($('#pickup-section .bxslider .list li').length > 1){
71    $('#pickup-section .bxslider .list').bxSlider({
72      auto: true
73      ,autoControls: true
74      ,speed:1000
75      ,pause:5000
76      ,slideWidth: 640
77      ,autoControlsCombine: true
78      ,hideControlOnEnd:false
79      ,captions: false
80      ,controls: true
81      ,nextSelector: '.pickup-slider-btn-next'
82      ,prevSelector: '.pickup-slider-btn-prev'
83      ,onSliderLoad:function(currentIndex){
84      }
85    });
86  }
87
88  //愛荘町のいま
89  if($('#town-now-section .bxslider .list li').length > 1){
90    $('#town-now-section .bxslider .list').bxSlider({
91      auto: true
92      ,autoControls: true
93      ,speed:1000
94      ,pause:5000
95      ,slideWidth: 640
96      ,maxSlides: 1
97      ,minSlides: 1
98      ,autoControlsCombine: true
99      ,hideControlOnEnd:false
100      ,captions: true
101      ,controls: true
102      ,nextSelector: '.town-now-slider-btn-next'
103      ,prevSelector: '.town-now-slider-btn-prev'
104      ,onSliderLoad:function(currentIndex){
105      }
106    });
107  }
108
109  } else {
110
111//スライダー(PC側)
112
113  //ピックアップスライダー
114  if($('#pickup-section .bxslider .list li').length > 3){
115    $('#pickup-section .bxslider .list').bxSlider({
116      auto: true
117      ,autoControls: true
118      ,speed:1000
119      ,pause:5000
120      ,slideWidth: 310
121      ,maxSlides: 3
122      ,minSlides: 1
123      ,autoControlsCombine: true
124      ,hideControlOnEnd:false
125      ,captions: false
126      ,controls: true
127      ,nextSelector: '.pickup-slider-btn-next'
128      ,prevSelector: '.pickup-slider-btn-prev'
129      ,onSliderLoad:function(currentIndex){
130      }
131    });
132    $('#pickup-section').css('overflow','hidden');
133  }else{
134    $('#pickup-section .bx-controls-direction').css('display','none');
135    $('#pickup-section').addClass('slider-none');
136  }
137
138  //愛荘町のいま
139  if($('#town-now-section .bxslider .list li').length > 4){
140    $('#town-now-section .bxslider .list').bxSlider({
141      auto: true
142      ,autoControls: true
143      ,speed:1000
144      ,pause:5000
145      ,maxSlides: 2
146      ,minSlides: 2
147      ,slideWidth: 440
148      ,autoControlsCombine: true
149      ,hideControlOnEnd:false
150      ,captions: true
151      ,controls: true
152      ,nextSelector: '.town-now-slider-btn-next'
153      ,prevSelector: '.town-now-slider-btn-prev'
154      ,onSliderLoad:function(currentIndex){
155      }
156    });
157  }else{
158    $('#town-now-section .bx-controls-direction').css('display','none');
159    $('#town-now-section').addClass('slider-none');
160  }
161
162}
163
164  // IEのオブジェクトフィット対応
165  objectFitImages('.obj-fit-img img');
166
167  // よく見られるページ出力(アナリティクス連携)
168  if(pluginExists('gaRanking')){
169    $('#kurashi-tab .ranking-area').gaRanking({titleName:"よく見られているページ(くらし・手続き)",profileNo:1,limit:5,replaceStr:'/愛荘町',printError:"#kurashi-tab .ranking-in"});
170    $('#kenko-tab .ranking-area').gaRanking({titleName:"よく見られているページ(健康・福祉)",profileNo:2,limit:5,replaceStr:'/愛荘町',printError:"#kenko-tab .ranking-in"});
171    $('#kosodate-tab .ranking-area').gaRanking({titleName:"よく見られているページ(子育て・教育)",profileNo:3,limit:5,replaceStr:'/愛荘町',printError:"#kosodate-tab .ranking-in"});
172    $('#sangyo-tab .ranking-area').gaRanking({titleName:"よく見られているページ(産業・観光)",profileNo:4,limit:5,replaceStr:'/愛荘町',printError:"#sangyo-tab .ranking-in"});
173    $('#chosei-tab .ranking-area').gaRanking({titleName:"よく見られているページ(町政情報)",profileNo:5,limit:5,replaceStr:'/愛荘町',printError:"#chosei-tab .ranking-in"});
174    $('#saiyo-tab .ranking-area').gaRanking({titleName:"よく見られているページ(採用情報)",profileNo:6,limit:5,replaceStr:'/愛荘町',printError:"#saiyo-tab .ranking-in"});
175  }
176
177});

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.