PageSourceSearch

https://epark.jp/v2/js/genre/genre.js?ver=202609151215

js epark.jp collected 2026-09-24 09:11:38 UTC 5,666 bytes, 147 lines download raw bytes

1// JavaScript Document
2$(window).on('load', function(){
3  if(navigator.userAgent.match(/(iPhone|Android)/)){
4    var categoryHeight = $('#category_ul').outerHeight();
5    var popularHeight = $('#popular_ul').outerHeight();
6    var particularHeight = $('#particular_ul').outerHeight();
7    var purposeHeight = $('#purpose_ul').outerHeight();
8    var examinationHeight = $('#examination_ul').outerHeight();
9    var treatmentHeight = $('#treatment_ul').outerHeight();
10    var dayOfWeekHeight = $('#day_of_week_ul').outerHeight();
11    var ageHeight = $('#age_ul').outerHeight();
12
13    $('#category_ul').css('height', '0');
14    $('#category_ul').css('max-height', categoryHeight);
15
16    $('#popular_ul').css('height', '0');
17    $('#popular_ul').css('max-height', popularHeight);
18
19    $('#particular_ul').css('height', '0');
20    $('#particular_ul').css('max-height', particularHeight);
21
22    $('#purpose_ul').css('height', '0');
23    $('#purpose_ul').css('max-height', purposeHeight);
24
25    $('#examination_ul').css('height', '0');
26    $('#examination_ul').css('max-height', examinationHeight);
27
28    $('#treatment_ul').css('height', '0');
29    $('#treatment_ul').css('max-height', treatmentHeight);
30
31    $('#day_of_week_ul').css('height', '0');
32    $('#day_of_week_ul').css('max-height', dayOfWeekHeight);
33
34    $('#age_ul').css('height', '0');
35    $('#age_ul').css('max-height', ageHeight);
36  }
37
38  // 検索フォームモーダル表示可否判定
39  if (isOpenGenreSuggestModal()) {
40    // モーダルオープン
41    $('.btn_open_search_modal_genre').click();
42    // 履歴情報破棄
43    history.pushState(null, null, null);
44  }
45
46  // アコーディオン開閉用のチェックボックスの値が変更されたら
47  $('.genre_checkbox').change(function() {
48    var target = $(this).data('target');
49
50    if ($(this).is(':checked')) {
51      // チェックされている場合
52      var height = $('#' + target + '_ul').css('max-height');
53      $('#' + target + '_ul').css('border-top', 'solid 1px #ccc');
54      $('#' + target + '_ul').css('height', height);
55    } else {
56      // チェックされていない場合
57      $('#' + target + '_ul').css('height', '0');
58      $('#' + target + '_ul').css('border-top', 'none');
59    }
60  });
61
62  // カテゴリ・こだわりテーブル用アコーディオン開閉用のチェックボックスの値が変更されたら
63  $('.table_open_checkbox').change(function() {
64    var target = $(this).data('target');
65    var accordionText = 'すべてのカテゴリを見る';
66    if (target === 'particular') {
67      accordionText = 'すべてのこだわり条件を見る';
68    } else if (target === 'examination') {
69      accordionText = 'すべての診療科目を見る';
70    } else if (target === 'treatment') {
71      accordionText = 'すべての治療内容を見る';
72    } else if (target === 'purpose') {
73      accordionText = 'すべての目的を見る';
74    } else if (target === 'day_of_week') {
75      accordionText = 'すべての曜日を見る';
76    } else if (target === 'age') {
77      accordionText = 'すべての対象年齢を見る';
78    }
79
80    if ($(this).is(':checked')) {
81      // チェックされている場合
82      var height = $('#' + target + '_ul').css('max-height');
83      $('#' + target + '_ul').css('height', height);
84      if ($('#' + target).find('.genre_accordion_' + target).length > 0) {
85        $('.genre_accordion_' + target).text('閉じる').addClass('accordion_close').removeClass('accordion_open');
86      }
87    } else {
88      // チェックされていない場合
89      $('#' + target + '_ul').css('height', '0');
90      if ($('#' + target).find('.genre_accordion_' + target).length > 0) {
91        $('.genre_accordion_' + target).text(accordionText).addClass('accordion_open').removeClass('accordion_close');
92      }
93    }
94  });
95
96  // .genre_ad_banner_pcの要素内にgenre_ad_banner_pc_imgクラスがあれば広告エリアを表示する
97  if ($('.genre_ad_banner_pc').find('.genre_ad_banner_pc_img').length > 0) {
98    $('.genre_ad_banner_pc').css('display', 'block');
99  }
100
101  // GENRE-TOP セグメントバナー表示制御
102  setTimeout(function() {
103    if (!$('.genre_ad_banner').find('a').length) {
104      $('.genre_ad_banner').addClass('banner_request_off');
105    }
106  }, 500);
107
108  if(!navigator.userAgent.match(/(iPhone|Android)/)){
109    set_height('service_box');
110  }
111
112  function set_height(array){
113    var set_height_obj = array.split(',');
114    var set_height_array = [];
115    $.each(set_height_obj, function(i, val){
116      $('.' + val + ' a').each(function(){
117        set_height_array.push($(this).outerHeight());
118      });
119      $('.' + val + ' a').css('height', Math.max.apply(null,set_height_array) + 'px');
120      set_height_array = [];
121    });
122  }
123
124  // 履歴情報からモーダル表示可否を判定する
125  function isOpenGenreSuggestModal() {
126    return history.state !== null && typeof (history.state.search_url) !== 'undefined' && history.state.search_url === location.href;
127  }
128
129  // #category へスムーススクロール
130  (function smoothScrollToCategoryOnLoad(){
131    // URLに#categoryが含まれている場合のみ動作
132    if (location.hash !== '#category') return;
133  
134    // 優先順位でターゲットを探す
135    var $target = $('#category');
136    if (!$target.length) $target = $('#treatment');   // 歯医者用
137    if (!$target.length) $target = $('#examination'); // 病院用
138  
139    // どれも見つからなければ終了
140    if (!$target.length) return;
141
142    setTimeout(function(){
143      var top = $target.offset().top;
144      $('html, body').stop(true).animate({ scrollTop: top }, 400, 'swing');
145    }, 0);
146  })();
147});

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.