PageSourceSearch

https://tosonline.jp/common/js/base.js?v=2025112501

js tosonline.jp collected 2026-10-02 06:15:56 UTC 8,944 bytes, 233 lines download raw bytes

1
2// スムーズスクロールjs
3$(function(){
4    $('a[href^="#"]').click(function(){
5      var speed = 500;
6      var href= $(this).attr("href");
7      var target = $(href == "#" || href == "" ? 'html' : href);
8      var position = target.offset().top;
9      $("html, body").animate({scrollTop:position}, speed, "swing");
10      return false;
11    });
12  });
13  
14  $(window).on('load', function (){
15      var windowWidth = window.innerWidth;
16      var ipadSize = "768";
17      var topbox = ".top_content .inner > .box";
18      let url = location.pathname;
19      // トップは4件ずつ それ以外は24件、もっと見るで 12件ずつ表示
20      var top_view_post = 12;   // 見出しの表示件数
21      var more_view_post = 12;  // もっと見るの表示件数
22      // SP版表示件数 8xN
23      var sp_view_roop_cnt = 1;
24      if(url != "/"){
25        if(windowWidth >= ipadSize){
26            top_view_post = 24;
27        }else{
28            // SP時
29            sp_view_roop_cnt = 3;
30        }
31      }
32      if(windowWidth >= ipadSize){// ipad以上の画面サイズ(pc)の時
33          // .boxに親要素追加
34          $(topbox).slice(0 , 12).addClass('new');
35          $(topbox).eq(0).wrap( '<section class="large_block"></section>' );
36          $(topbox).slice(0 , 3).wrapAll( '<section class="small_block"></section>' );
37          $(topbox).slice(0 , top_view_post).wrapAll( '<section class="middle_block"></section>' );
38
39          $(topbox).wrapAll( '<section class="middle_block"></section>' ).addClass( 'hide_box' );
40        //   $(function(){
41        //     $("img.photo_img").lazyload({
42        //         skip_invisible: true,
43        //     });
44        //     $("img.photo_img").show().lazyload({
45        //         // skip_invisible: true,
46        //         effect : "fadeIn",
47        //     });
48        //     console.log('lazy');
49        // });
50          // .box内、文字数制限
51          $('.box .text_area .text p').each(function(){
52              if ($(this).text().length > 34) {
53                  $(this).text($(this).text().substr(0, 33)); 
54                  $(this).append('...');
55              }
56          });
57          $('.box .tag_area .tag').each(function(){
58              if ($(this).text().length > 7) {
59                  $(this).text($(this).text().substr(0, 6)); 
60                  $(this).append('...');
61              }
62            //   $("img.photo_img").lazyload({
63            //     skip_invisible: true,
64            // });
65            // $("img.photo_img").show().lazyload({
66            //     // skip_invisible: true,
67            //     effect : "fadeIn",
68            // });
69          });
70          $('#gallery #title h2 a').each(function(){
71            if ($(this).text().length > 29) {
72                $(this).text($(this).text().substr(0, 28)); 
73                $(this).append('...');
74            }
75        });
76      } else {// ipad未満の画面サイズ(sp)の時
77          // .boxに親要素追加
78          for(let i = 0; i <sp_view_roop_cnt; i++ ){
79            $(topbox).slice(0 , 5).wrapAll( '<section class="minimum_block"></section>' );
80            $(topbox).eq(0).wrapAll( '<section class="large_block"></section>' );
81            $(topbox).slice(0 , 12).wrapAll( '<section class="middle_block"></section>' );
82          }
83          $(topbox).wrapAll( '<section class="small_block"></section>' ).addClass( 'hide_box' );
84        //   $(function(){
85        //     $("img.photo_img").lazyload({
86        //         skip_invisible: true,
87        //     });
88        //     $("img.photo_img").show().lazyload({
89        //         // skip_invisible: true,
90        //         effect : "fadeIn",
91        //     });
92        //     console.log('lazy');
93        // });
94        // .box内、文字数制限
95        //   $('.box .text_area .text p.long').each(function(){
96        //       if ($(this).text().length > 30) {
97        //           $(this).text($(this).text().substr(0, 29)); 
98        //           $(this).append('...');
99        //       }
100        //   });
101        //   $('.box .text_area .text p').each(function(){
102        //     if ($(this).text().length > 30) {
103        //         $(this).text($(this).text().substr(0, 29)); 
104        //         $(this).append('...');
105        //     }
106        // });
107          $('.box .tag_area .tag').each(function(){
108              if ($(this).text().length > 7) {
109                  $(this).text($(this).text().substr(0, 6)); 
110                  $(this).append('...');
111              }
112          });
113          $('#gallery #title h2').each(function(){
114            if ($(this).text().length > 17) {
115                $(this).text($(this).text().substr(0, 16)); 
116                $(this).append('...');
117            }
118        });
119          $(".middle_block .box").autoHeight({column:2, clear:1});
120        //   $("img.photo_img").lazyload({
121        //     skip_invisible: true,
122        // });
123        // $("img.photo_img").show().lazyload({
124        //     // skip_invisible: true,
125        //     effect : "fadeIn",
126        // });
127        // console.log('lazy');
128      }
129      var hide_box = ".hide_box";
130      var more_btn = ".more_btn .btn";
131      var i = 0;
132      $(hide_box).hide();
133      $(more_btn).click(function(){
134          $(hide_box).slice(0 , more_view_post).fadeIn(500).removeClass('hide_box');
135          i= $(hide_box).length;
136          if(i <= 0){
137              $('.more_btn').hide();
138          }
139      });
140      // large small middle 以下のaタグを全て display blockする
141  });
142  
143  $(function(){
144      $(".menu_opener").on("click", function() {
145          $("#menu_block").addClass("on");
146      });
147      $(".menu_close").on("click", function() {
148          $("#menu_block").removeClass("on");
149      });
150      $(".search_opener").on("click", function() {
151          $(".search").addClass("on");
152      });
153      $(".search_close").on("click", function() {
154          $(".search").removeClass("on");
155      });
156  });
157  $(function(){
158      // ナビゲーションfixed
159      var topNav = $('#main_nav');
160      var margin = $('#nowCast');
161      var topNav_Top = topNav.offset().top;
162      var topNav_InHeight = topNav.outerHeight();
163      function fixedNav(){
164          if(($(window).scrollTop()) >= topNav_Top) {
165              topNav.addClass('fixed');
166              margin.css('padding-bottom' , (topNav_InHeight)+'px');
167          }else{
168              topNav.removeClass('fixed');
169              margin.css('padding-bottom','')
170          }
171      }
172      $(window).on('load scroll resize', function(){
173      fixedNav();
174      });
175  });
176  $(function(){
177      var innerWidth = $(".nav_list").outerWidth();
178      if(innerWidth > 1200){
179          $(".arrow_btn").addClass("over-mode");
180          $(".scrollArea").addClass("over-mode");
181      } 
182      $(document).on('click', '.right', function(){
183        $('.scrollArea').animate({
184            scrollLeft:$('.scrollArea').scrollLeft()+500
185        },300); 
186        return false;
187      });
188      $(document).on('click', '.left', function(){
189        $('.scrollArea').animate({
190          scrollLeft:$('.scrollArea').scrollLeft() - 500
191        }, 300);
192        return false;
193      });
194  });
195  
196  // お問い合わせページについては
197  // バナーと、SNS共有アイコンを表示しない
198  // $(function(){
199  //     if($('#contact').children().has('bottom_sns_area','menu_sns_area','bottom_bnr_area')) {
200  // 		$("#bottom_sns_area").remove();
201  // 		$("#menu_sns_area").remove();
202  // 		$("#bottom_bnr_area").remove();
203  // 		console.log("1");
204  //     } else {
205  //     }
206  // });
207  
208  // $(function(){
209  //     if($('#contact').has('bottom_sns_area')) {
210  // 		$("#bottom_sns_area").remove();
211  // 		$("#menu_sns_area").remove();
212  // 		$("#bottom_bnr_area").remove();
213  // 		console.log("1");
214  //     } else {
215  //     }
216  // });
217
218//   //記事詳細ページのmainVisualのyoutubeとgoogleAdがファーストビューの中で共存しないよう、marginを調整する
219//     $(function(){
220//         //$('#mainVisual')の子がiframeだった時
221//         if($('#main_visual').children().is('iframe')) {
222//             //.g_ad_footerの現在地が端末のビューの中にある時
223//             var mvBottom = $('#main_visual').offset().top + $('#main_visual').outerHeight();
224//             var endPoint = mvBottom + screen.height;
225//             if($('.g_ad_footer').offset().top < endPoint){
226//                 var marginBottom = endPoint - $('.g_ad_footer').offset().top;
227//                 //.content_blockのmargin-bottomを使って.g_ad_footerが画面の中に入らないようにする
228//                 $('.content_block').css('margin-bottom', marginBottom +'px');
229//             }
230//         }
231//     });
232
233

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.