PageSourceSearch

https://toyotagazooracing.com/-/media/TMC/tgr/global/assets/js/function.js

js toyotagazooracing.com collected 2026-10-02 04:31:44 UTC 7,899 bytes, 208 lines download raw bytes

1$(function(){
2  $(".animated_container").on('inview', function(event, isInView) {
3    if (isInView) {
4      $(this).addClass("view");
5    }
6  });
7
8  $(".acordion-box .ac_btn").on("click", function(){
9    $(this).toggleClass("active");
10    $(this).next(".ac_box").stop().slideToggle(200).toggleClass("active");
11  });
12
13  $(".tab-switching-opener").on("click", function(){
14    $(this).toggleClass("opened");
15    $(this).prev(".tab-switching-inner-menu").addClass("opened");
16    // $('.round_content').slick('slickSetOption','adaptiveHeight',true,true);
17  });
18});
19
20$(function() {
21  //[.anker_scroll]がついてるボタンにスムーズスクロール
22  $(".anker_scroll").click(function(event){
23  event.preventDefault();
24  var url = this.href;
25  var parts = url.split("#");
26  var target = parts[1];
27  var target_offset = $("#"+target).offset();
28  var target_top = target_offset.top;
29  $('html, body').stop().animate({scrollTop:target_top}, 200);
30  });
31});
32
33/* Garage & OFFICIAL SNS */
34function sns_magazine(){
35  $.ajax({
36    url: "/pages/global/assets/include/sns_magazine.html", // 読み込むHTMLファイル
37    cache: false,
38    async: false,
39    dataType: 'html',
40    success: function(html){
41      document.write(html);
42    }
43  });
44}
45
46$(window).on("load", function () {
47  // MOTOR SPORTS NEWS 赤ラベルが英語かそれ以外の場合でクラスを振り分ける
48  var newsCategory = $(".card_category");
49  for (var i = 0; i < newsCategory.length; i++) {
50    if(newsCategory.eq(i).text().charCodeAt(0) <= 256) {
51      newsCategory.eq(i).addClass('lang-en');
52    } else {
53      newsCategory.eq(i).addClass('lang-jp');
54    }
55  }
56
57  if ($(".tab-menus").get(0) !== undefined) {
58    $(".tab-menus").each(function() {
59      var length = ($(this).children('li').length);
60      if (length > 7) {
61        $(this).removeClass('justify-content-center').addClass('justify-content-md-center');
62      }
63    });
64  }
65
66  if ($("#tab-switching").get(0) !== undefined) {
67    // ラウンドナビゲーションのスクロールバーを非表示
68    var scrollEl = document.querySelector('#tab-switching .tab-menus')
69    var scr = new ScrollBooster({
70      viewport: document.querySelector('#tab-switching .scroll_inr'),
71      emulateScroll: true,
72      bounce: false,
73      mode: 'x',
74      onUpdate: function (data)  {
75        scrollEl.style.transform = 'translate(' + -data.position.x + 'px, ' + -data.position.y + 'px)'
76      },
77    })
78
79    // ラウンドナビゲーションのクラスis-currentが付いているボタンを中央配置
80    var menusWidth = $("#tab-switching .tab-menus").outerWidth() / 2;
81    var menuWidth = $("#tab-switching .tab-menus li").width() / 2;
82    var currentPosition = $("#tab-switching .tab-menus .is-current").offset().left;
83    scr.setPosition({
84      x: currentPosition - menusWidth + menuWidth
85    })
86  }
87
88  if ($(".tab-switching").get(0) !== undefined) {
89    $(".tab-switching").each(function(i){
90      // ラウンドナビゲーションのスクロールバーを非表示
91      var scrollEl = document.querySelector('.tab-switching'+i+' .tab-menus')
92      var scr = new ScrollBooster({
93        viewport: document.querySelector('.tab-switching'+i+' .scroll_inr'),
94        emulateScroll: true,
95        bounce: false,
96        mode: 'x',
97        onUpdate: function (data)  {
98          scrollEl.style.transform = 'translate(' + -data.position.x + 'px, ' + -data.position.y + 'px)'
99        },
100      })
101
102      // ラウンドナビゲーションのクラスis-currentが付いているボタンを中央配置
103      var menusWidth = $('.tab-switching'+i+' .tab-menus').outerWidth() / 2;
104      var menuWidth = $('.tab-switching'+i+' .tab-menus li').width() / 2;
105      var currentPosition = $('.tab-switching'+i+' .tab-menus .is-current').offset().left;
106      scr.setPosition({
107        x: currentPosition - menusWidth + menuWidth
108      })
109      $('.tab-switching'+i).parent('.tab-switching-wrap.ac_box:not(.active)').hide(); // クラスactiveを記述すればデフォルトで開いた状態で表示
110    });
111  }
112
113  // SPのみ ラウンドパネル内ボタンが2つ以下で「MORE」ボタンを非表示
114  var menusLength = $('.tab-switching-inner-menu').length;
115  for (var i=0; menusLength > i ; i++ ) {
116    if ($('.tab-switching-inner-menu').eq(i).children("li").length <= 2) {
117      $('.tab-switching-inner-menu').eq(i).next(".tab-switching-opener").addClass('d-none');
118    }
119  }
120
121  // レポートページ用JS
122  setTimeout($(window).on('load resize', function(){
123  var heightsum = $( '.gh-main-header' ).outerHeight(true) + $( '#contents-top-navigation' ).outerHeight(true);
124  $( '.round-navi_head' ).css( 'top' , heightsum );
125  }),3000);
126
127  if ($(".round-navi_head").get(0) !== undefined) {
128    $('.round-select option[value="round1"]').wrap('<span class="d-none">');
129
130    $('.tmp_localnav_report a').each(function(){
131      var $href = $(this).attr('href');
132      if(location.pathname==$href) {
133        $(this).parent('li').addClass('current-position');
134      } else {
135        $(this).parent('li').removeClass('current-position');
136      }
137    });
138
139    // ラウンドナビのスクロールバーを非表示
140    var scrollEl = document.querySelector('.scroll_inr ul')
141    var scr = new ScrollBooster({
142      viewport: document.querySelector('.scroll_inr'),
143      emulateScroll: true,
144      bounce: false,
145      mode: 'x',
146      onUpdate: function (data)  {
147        scrollEl.style.transform = 'translate(' + -data.position.x + 'px, ' + -data.position.y + 'px)'
148      },
149    })
150    scr.setPosition({
151      x: 0
152    })
153
154    // Inter Round Link - PC
155    var myRound = Number( $('.tmp_localnav_report>ul').data('import').slice(-2) );
156    $('#inter-round-navi .menu-list').addClass('current-' + myRound);
157    $('#inter-round-navi .menu' + myRound + ' a').addClass('nolink');
158
159    // Inter Round Link - SP
160    var currentRound = $('.round-navi_head .menu-list').find('.menu' + myRound).text();
161    $('.current-round').append(currentRound);
162    $('.current-round').on('click', function(){
163      $(this).toggleClass('open');
164      $(this).next('ul').toggleClass('open');
165    });
166  }
167});
168
169$(function(){
170  var windowWidth = window.innerWidth;
171  var $setElm = $('.slider_top .slick-slide p'); // 省略する文字のあるセレクタを取得
172  var afterTxt = '…'; // 文字カット後に表示するテキスト
173  if (windowWidth > 769) {
174    var cutFigure = '80';
175  } else {
176    var cutFigure = '55';
177  }
178
179  $setElm.each(function(){
180    var textLength = $(this).text().length;  // htmlタグを抜いた文字数を取得
181    if ($(this).html().indexOf('<br>') && $(this).html().indexOf('</dfn>') != -1) {
182      var textTrim = $(this).html().substr(0,(parseInt(cutFigure) + 33))
183    } else if ($(this).html().indexOf('<br>') != -1) {
184      var textTrim = $(this).html().substr(0,(parseInt(cutFigure) + 4))
185    } else if ($(this).html().indexOf('<br class="d-md-none">') != -1) {
186      var textTrim = $(this).html().substr(0,(parseInt(cutFigure) + 22))
187    } else if ($(this).html().indexOf('</dfn>') != -1) {
188      var textTrim = $(this).html().substr(0,(parseInt(cutFigure) + 29))
189    } else {
190      var textTrim = $(this).html().substr(0,(cutFigure))
191    }
192    if(cutFigure < textLength) { // 文字数が表示数より多い場合
193      $(this).html(textTrim + afterTxt); // カット後の文字数に…を追加
194    }
195  });
196});
197
198$(function(){
199	$(window).on('load', function(){
200		var lochref = window.location.href;
201		if ( lochref.indexOf('#') > -1 ) {
202			var anchor = lochref.slice( lochref.indexOf('#') );
203			window.setTimeout(function(){
204				$('body, html').animate({ scrollTop: $(anchor).offset().top }, 1);
205			}, 2000);
206		}
207	});
208});

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.