/*jslint browser: true, plusplus: true */ /*global $, jQuery, Snap*/ // JavaScript Document // グローバル var $ua = navigator.userAgent.toLowerCase(), $scrollto_flg = false; // ページ内スクロール var $scrollto = (function () { 'use strict'; return { fDone: function ($attr, $speed) { var $target = $($attr), $scroll_speed = ($speed !== undefined) ? $speed : 500, $pos, $margin; if ($target.length > 0) { $pos = 1; if ($attr !== '#anc_top') { $pos += $target.offset().top; } $margin = parseInt($target.attr('data-scrollto-margin'), 10); if ($margin) { $pos += $margin; } $('html,body').stop().animate({ scrollTop: $pos }, $scroll_speed, function () { $scrollto_flg = false; }); } }, fInit: function () { // ページ内スクロールボタン $('.js_scrollto').off().on('click', function () { $scrollto_flg = true; var $attr = $(this).attr('data-href'); $scrollto.fDone($attr); return false; }); } }; }()); var $side_navi = (function () { 'use strict'; var $target, $target_height, $pos; return { fInit: function () { $target = $('.js_top_subnavi'); $target_height = $target.outerHeight(); }, fPos: function ($window_height) { $pos = $window_height - $target_height; $pos = $pos / 2; } }; }()); // スクロール位置によって画像表示判定 var $sv = (function () { 'use strict'; // 使いまわす変数はクロージャ内に記載する。 // easing : _sv.scss(transition) // opacity : _sv.scss(opacity) // motion : _sv.scss(translateY/translateX) // delay : html(data-sv-delay) var $window, $window_height, // 画面縦幅 $scroll_top, // スクロール位置 $handle_cur_class = 'tp_sv_cur', $handle_class = '.js_sv', $handle_obj, $handle_status, $scroll_listener_flg = false, $page_name, $scroll_timer, $slide_timer, $count = 2, $count_max = 2, // 間引きカウント $page_index_flg, // custom $page_uui_flg, // custom $mainvisual_target, // custom $mainvisual_pos, // custom $footer_target, // custom $footer_pos, // custom $top_subnavi, // custom $scroll_top_btn; // scroll_top_btn return { fCheckCustom: function ($option) { if ($scrollto_flg === false) { clearTimeout($scroll_timer); $scroll_timer = setTimeout(function () { $footer_pos = $footer_target.offset().top; if ($scroll_top < $mainvisual_pos || $scroll_top + $window_height > $footer_pos) { $scroll_top_btn.removeClass('tp_scroll_top_in'); } else { $scroll_top_btn.addClass('tp_scroll_top_in'); } if ($page_index_flg.length !== 0 || $page_uui_flg.length !== 0) { if ($scroll_top < $mainvisual_pos / 2 || $scroll_top + $window_height > $footer_pos) { $top_subnavi.removeClass('tp_subnavi_in'); } else { $top_subnavi.addClass('tp_subnavi_in'); $side_navi.fPos($window_height); } } return false; }, 200); } }, // 表示チェック全般処理 fCheckVisible: function () { var $i; // 現在のスクロール状況を取得 $window_height = $window.height(); $scroll_top = $window.scrollTop(); for ($i = 0; $i < $handle_status.length; $i++) { // 非表示の時だけ処理する。 if (!$handle_status[$i].$visible) { $sv.fCheckStatus($i); } } // カスタム処理 $sv.fCheckCustom(); }, // 表示チェック個別処理 fCheckStatus: function ($key) { var $obj = $handle_status[$key], $target_pos, $target_pos_delta, $target_height, $flg; if (typeof $obj.$option.$type === 'undefined') { $target_pos = $obj.$target.offset().top; $target_height = $obj.$target.outerHeight(); $flg = false; if ($scroll_top + $window_height > $target_pos + ($target_height) - 100) { // 要素が画面にすべて収まった場合 $flg = true; } else if ($scroll_top + ($window_height * 0.5) > $target_pos) { // 要素が画面の中央より上部に入った場合 $flg = true; } if ($flg) { $obj.$target.delay($obj.$option.$delay).queue(function () { $obj.$target.addClass($handle_cur_class); $obj.$target.dequeue(); }); $handle_status[$key].$visible = true; } } else { $flg = false; if ($obj.$option.$type === 'parallax_t') { $target_pos = $obj.$target.offset().top; $target_pos_delta = $scroll_top - $target_pos; $obj.$target.css('transform', 'translateY(' + ($obj.$option.$pos * $target_pos_delta) + 'px)'); } else if ($obj.$option.$type === 'parallax_b') { $target_height = $obj.$target.outerHeight(); $target_pos = $obj.$target.offset().top + $target_height; $target_pos_delta = $scroll_top - $target_pos; $obj.$target.css('transform', 'translateY(' + ($obj.$option.$pos * $target_pos_delta) + 'px)'); } else { if ($obj.$option.$type === 'show') { if ($obj.$option.$pos < $scroll_top) { $flg = true; } } else if ($obj.$option.$type === 'hide') { if ($obj.$option.$pos > $scroll_top) { $flg = true; } } $obj.$target.delay($obj.$option.$delay).queue(function () { $obj.$target.toggleClass($handle_cur_class, $flg); $obj.$target.dequeue(); }); } } }, // 初期化 fInit: function () { var $i, $target_delay; $target_delay = 'data-sv-delay'; /* custom_init */ $page_index_flg = $('.page_index'); $page_uui_flg = $('.page_uui'); $top_subnavi = $('.js_top_subnavi'); $mainvisual_target = $('.js_mainvisual'); $footer_target = $('.js_footer'); $scroll_top_btn = $('.js_scroll_top'); // 対象取得 $handle_obj = $($handle_class); $window = $(window); $window_height = $window.height(); // 対象の情報をオブジェクトに格納 $handle_status = []; for ($i = 0; $i < $handle_obj.length; $i++) { $handle_status.push({ $key: $i, $target: $handle_obj.eq($i), $visible: false, $option: { $delay: parseInt($handle_obj.eq($i).attr($target_delay), 10), $type: $handle_obj.eq($i).attr('data-sv-type'), $pos: $handle_obj.eq($i).attr('data-sv') } }); } // リスナー登録 if (!$scroll_listener_flg) { $window.on('scroll', function () { // $count++; // if($count > $count_max){ // $sv.fCheckVisible(); // $count = 0; // } // iPadで間引きが悪影響? $sv.fCheckVisible(); }); $scroll_listener_flg = true; } // 初回実行 $sv.fCheckVisible(); } }; }()); // TOPページ メインビジュアルの雲 var $cloud_svg = (function () { 'use strict'; var $fill_color, $cloud_target, $motion_time, $motion_num, $hover_flg, $hover_target, $hover_cur, $motion_target, $motion_path, $cloud_path00, $cloud_path01, $cloud_path02, $artboard00, $artboard01, $artboard02, $snap_cloud00, $snap_cloud01, $snap_cloud02, $filter_shadow, $filter00, $filter01, $filter02; return { fInit: function () { $hover_target = $('.js_cloud_hover_target'); $motion_time = 1500; $motion_num = [1, 2, 3]; $fill_color = '#fce6ea'; $cloud_target = [ '.js_svg_cloud00', '.js_svg_cloud01', '.js_svg_cloud02' ]; $filter_shadow = Snap.filter.shadow(0, 3, 0, '#f299b2', 1); $artboard00 = new Snap($cloud_target[0]); $artboard01 = new Snap($cloud_target[1]); $artboard02 = new Snap($cloud_target[2]); //$filter00 = $artboard00.filter($filter_shadow); //$filter01 = $artboard01.filter($filter_shadow); //$filter02 = $artboard02.filter($filter_shadow); /* $cloud_path00 = [ 'M180.653,39.58c-7.974-18.493-24.05-32.305-44.809-36.835c-16.461-3.592-31.495-1.494-43.862,5.083c-2.225-0.857-4.574-1.63-7.087-2.29c-28.062-7.36-56.7,16.526-60.114,44.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,6.051,71.686,3.525,79.34c-9.76,29.563,10.144,62.979,36.115,68.816c1.104,0.248,3.698,0.481,6.054,0.669c3.968,14.802,16.01,26.603,31.57,29.046c12.196,1.915,23.854-2.347,32.065-10.516c7.523,3.876,16.094,6.733,25.038,8.137c29.322,4.604,55.396-8.527,58.237-29.334c0.509-3.723,0.286-7.389-0.57-10.938c12.368-7.294,21.613-19.968,24.328-35.649C220.958,73.029,205.223,47.304,180.653,39.58z', 'M177.653,41.58c-7.974-18.493-21.05-31.305-41.809-35.835c-16.461-3.592-31.495,2.506-43.862,9.083c-2.225-0.857-4.574-2.63-7.087-3.29c-28.062-7.36-56.7,10.526-60.114,38.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,6.051,71.686,3.525,79.34c-9.76,29.563,10.144,60.979,36.115,66.816c1.104,0.248,6.698,0.481,9.054,0.669c3.968,14.802,10.01,25.603,25.57,28.046c12.196,1.915,26.854-2.347,35.065-10.516c7.523,3.876,16.094,7.733,25.038,9.137c29.322,4.604,51.396-5.527,54.237-26.334c0.509-3.723,0.286-8.389-0.57-11.938c12.368-7.294,21.613-19.968,24.328-35.649C216.958,73.029,202.223,49.304,177.653,41.58z', 'M181.653,42.58c-7.974-18.493-22.05-35.305-42.809-39.835c-16.461-3.592-28.495-0.494-40.862,6.083c-2.225-0.857-7.574-2.63-10.087-3.29c-28.062-7.36-59.7,16.526-63.114,44.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,6.051,68.686,3.525,76.34c-9.76,29.563,7.144,62.979,33.115,68.816c1.104,0.248,4.698,1.481,7.054,1.669c3.968,14.802,15.01,28.603,30.57,31.046c12.196,1.915,23.854-2.347,32.065-10.516c7.523,3.876,16.094,6.733,25.038,8.137c29.322,4.604,56.396-6.527,59.237-27.334c0.509-3.723,2.286-8.389,1.43-11.938c12.368-7.294,20.613-17.968,23.328-33.649C219.958,76.029,206.223,50.304,181.653,42.58z', 'M180.653,44.58c-7.974-18.493-20.05-34.305-40.809-38.835c-16.461-3.592-31.495,2.506-43.862,9.083c-2.225-0.857-8.574-2.63-11.087-3.29c-28.062-7.36-56.7,10.526-60.114,38.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,8.051,69.686,5.525,77.34c-9.76,29.563,5.144,61.979,31.115,67.816c1.104,0.248,7.698,2.481,10.054,2.669c3.968,14.802,8.01,23.603,23.57,26.046c12.196,1.915,27.854-1.347,36.065-9.516c7.523,3.876,15.094,7.733,24.038,9.137c29.322,4.604,55.396-5.527,58.237-26.334c0.509-3.723,0.286-5.389-0.57-8.938c12.368-7.294,20.613-20.968,23.328-36.649C215.958,75.029,205.223,52.304,180.653,44.58z' ]; $cloud_path01 = [ 'M180.653,39.58c-7.974-18.493-24.05-32.305-44.809-36.835c-16.461-3.592-31.495-1.494-43.862,5.083c-2.225-0.857-4.574-1.63-7.087-2.29c-28.062-7.36-56.7,16.526-60.114,44.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,6.051,71.686,3.525,79.34c-9.76,29.563,10.144,62.979,36.115,68.816c1.104,0.248,3.698,0.481,6.054,0.669c3.968,14.802,16.01,26.603,31.57,29.046c12.196,1.915,23.854-2.347,32.065-10.516c7.523,3.876,16.094,6.733,25.038,8.137c29.322,4.604,55.396-8.527,58.237-29.334c0.509-3.723,0.286-7.389-0.57-10.938c12.368-7.294,21.613-19.968,24.328-35.649C220.958,73.029,205.223,47.304,180.653,39.58z', 'M177.653,41.58c-7.974-18.493-21.05-31.305-41.809-35.835c-16.461-3.592-31.495,2.506-43.862,9.083c-2.225-0.857-4.574-2.63-7.087-3.29c-28.062-7.36-56.7,10.526-60.114,38.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,6.051,71.686,3.525,79.34c-9.76,29.563,10.144,60.979,36.115,66.816c1.104,0.248,6.698,0.481,9.054,0.669c3.968,14.802,10.01,25.603,25.57,28.046c12.196,1.915,26.854-2.347,35.065-10.516c7.523,3.876,16.094,7.733,25.038,9.137c29.322,4.604,51.396-5.527,54.237-26.334c0.509-3.723,0.286-8.389-0.57-11.938c12.368-7.294,21.613-19.968,24.328-35.649C216.958,73.029,202.223,49.304,177.653,41.58z', 'M181.653,42.58c-7.974-18.493-22.05-35.305-42.809-39.835c-16.461-3.592-28.495-0.494-40.862,6.083c-2.225-0.857-7.574-2.63-10.087-3.29c-28.062-7.36-59.7,16.526-63.114,44.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,6.051,68.686,3.525,76.34c-9.76,29.563,7.144,62.979,33.115,68.816c1.104,0.248,4.698,1.481,7.054,1.669c3.968,14.802,15.01,28.603,30.57,31.046c12.196,1.915,23.854-2.347,32.065-10.516c7.523,3.876,16.094,6.733,25.038,8.137c29.322,4.604,56.396-6.527,59.237-27.334c0.509-3.723,2.286-8.389,1.43-11.938c12.368-7.294,20.613-17.968,23.328-33.649C219.958,76.029,206.223,50.304,181.653,42.58z', 'M180.653,44.58c-7.974-18.493-20.05-34.305-40.809-38.835c-16.461-3.592-31.495,2.506-43.862,9.083c-2.225-0.857-8.574-2.63-11.087-3.29c-28.062-7.36-56.7,10.526-60.114,38.374c-0.053,0.031-0.104,0.066-0.158,0.098c-2.77-0.551-5.471-1.195-7.692-1.929C8.548,45.304,1.873,32.747,1.873,32.747s-0.814,5.859,3.565,16.471c1.842,4.46,4.583,8.216,7.584,11.319C9.27,65.479,8.051,69.686,5.525,77.34c-9.76,29.563,5.144,61.979,31.115,67.816c1.104,0.248,7.698,2.481,10.054,2.669c3.968,14.802,8.01,23.603,23.57,26.046c12.196,1.915,27.854-1.347,36.065-9.516c7.523,3.876,15.094,7.733,24.038,9.137c29.322,4.604,55.396-5.527,58.237-26.334c0.509-3.723,0.286-5.389-0.57-8.938c12.368-7.294,20.613-20.968,23.328-36.649C215.958,75.029,205.223,52.304,180.653,44.58z' ]; $cloud_path02 = [ 'M196.516,39.58c-8.626-18.493-26.018-32.305-48.475-36.835c-17.808-3.592-34.072-1.494-47.451,5.083c-2.406-0.857-4.948-1.63-7.667-2.29c-30.358-7.36-61.339,16.526-65.033,44.374c-0.058,0.031-0.113,0.066-0.171,0.098c-2.997-0.551-5.918-1.195-8.321-1.929C10.33,45.304,3.107,32.747,3.107,32.747s-0.879,5.859,3.857,16.471c1.993,4.46,4.958,8.216,8.204,11.319c-4.059,4.941-7.54,11.148-10.272,18.803c-10.559,29.563,10.973,62.979,39.07,68.816c1.194,0.248,4,0.481,6.55,0.669c4.292,14.802,17.319,26.603,34.153,29.046c13.193,1.915,25.806-2.347,34.689-10.516c8.139,3.876,17.41,6.733,27.085,8.137c31.722,4.604,59.929-8.527,63.002-29.334c0.552-3.723,0.311-7.389-0.616-10.938c13.379-7.294,23.382-19.968,26.318-35.649C240.119,73.029,223.096,47.304,196.516,39.58z', 'M193.271,41.58c-8.626-18.493-22.772-31.305-45.229-35.835c-17.808-3.592-34.072,2.506-47.451,9.083c-2.406-0.857-4.948-2.63-7.667-3.29c-30.358-7.36-61.339,10.526-65.033,38.374c-0.058,0.031-0.113,0.066-0.171,0.098c-2.997-0.551-5.918-1.195-8.321-1.929C10.33,45.304,3.107,32.747,3.107,32.747s-0.879,5.859,3.857,16.471c1.993,4.46,4.958,8.216,8.204,11.319c-4.059,4.941-7.54,11.148-10.272,18.803c-10.559,29.563,10.973,60.979,39.07,66.816c1.194,0.248,7.246,0.481,9.795,0.669c4.293,14.802,10.829,25.603,27.663,28.046c13.193,1.915,29.051-2.347,37.935-10.516c8.139,3.876,17.41,7.733,27.085,9.137c31.722,4.604,55.602-5.527,58.675-26.334c0.552-3.723,0.31-8.389-0.616-11.938c13.38-7.294,23.381-19.968,26.318-35.649C235.791,73.029,219.851,49.304,193.271,41.58z', 'M197.597,42.58c-8.625-18.493-23.853-35.305-46.311-39.835c-17.808-3.592-30.826-0.494-44.205,6.083c-2.406-0.857-8.194-2.63-10.913-3.29c-30.358-7.36-64.585,16.526-68.278,44.374c-0.058,0.031-0.113,0.066-0.171,0.098c-2.997-0.551-5.918-1.195-8.321-1.929C10.33,45.304,3.107,32.747,3.107,32.747s-0.879,5.859,3.857,16.471c1.993,4.46,4.958,8.216,8.204,11.319c-4.059,4.941-7.54,8.148-10.272,15.803c-10.559,29.563,7.728,62.979,35.825,68.816c1.194,0.248,5.082,1.481,7.631,1.669c4.292,14.802,16.238,28.603,33.071,31.046c13.193,1.915,25.806-2.347,34.69-10.516c8.139,3.876,17.41,6.733,27.085,8.137c31.722,4.604,61.011-6.527,64.083-27.334c0.553-3.723,2.475-8.389,1.548-11.938c13.379-7.294,22.301-17.968,25.236-33.649C239.036,76.029,224.178,50.304,197.597,42.58z', 'M196.516,44.58c-8.626-18.493-21.69-34.305-44.147-38.835c-17.809-3.592-34.071,2.506-47.45,9.083c-2.407-0.857-9.275-2.63-11.995-3.29c-30.358-7.36-61.339,10.526-65.033,38.374c-0.058,0.031-0.113,0.066-0.171,0.098c-2.997-0.551-5.918-1.195-8.321-1.929C10.33,45.304,3.107,32.747,3.107,32.747s-0.879,5.859,3.857,16.471c1.993,4.46,4.958,8.216,8.204,11.319c-4.059,4.941-5.377,9.148-8.109,16.803c-10.558,29.563,5.564,61.979,33.662,67.816c1.194,0.248,8.328,2.481,10.877,2.669c4.292,14.802,8.665,23.603,25.499,26.046c13.193,1.915,30.133-1.347,39.017-9.516c8.139,3.876,16.329,7.733,26.002,9.137c31.723,4.604,59.93-5.527,63.003-26.334c0.552-3.723,0.31-5.389-0.616-8.938c13.38-7.294,22.3-20.968,25.236-36.649C234.71,75.029,223.096,52.304,196.516,44.58z' ]; */ /*$snap_cloud00 = $artboard00.path($cloud_path00[0]).attr({ 'fill': $fill_color, 'stroke': '#none', 'stroke-width': 0.5, 'stroke-miterlimit': 10, 'filter': $filter00 }); $snap_cloud01 = $artboard01.path($cloud_path01[0]).attr({ 'fill': $fill_color, 'stroke': '#none', 'stroke-width': 0.5, 'stroke-miterlimit': 10, 'filter': $filter01 }); $snap_cloud02 = $artboard02.path($cloud_path02[0]).attr({ 'fill': $fill_color, 'stroke': 'none', 'stroke-width': 0.5, 'stroke-miterlimit': 10, 'filter': $filter02 });*/ $cloud_svg.fAnimeLoop(0); setTimeout(function () { $cloud_svg.fAnimeLoop(1); }, 500); setTimeout(function () { $cloud_svg.fAnimeLoop(2); }, 1000); }, fAnimeLoop: function ($loop) { if ($loop === 0) { $motion_target = $snap_cloud00; $motion_path = $cloud_path00; } else if ($loop === 1) { $motion_target = $snap_cloud01; $motion_path = $cloud_path01; } else if ($loop === 2) { $motion_target = $snap_cloud02; $motion_path = $cloud_path02; } /* $motion_target.animate( { d: $motion_path[$motion_num[$loop]] }, $motion_time, function () { if ($motion_num[$loop] === 3) { $motion_num[$loop] = 0; } else { $motion_num[$loop] += 1; } $cloud_svg.fAnimeLoop($loop); } );*/ } }; }()); // 記事ページのサイドナビゲーション var $oab_sidenavi = (function () { 'use strict'; var $cotegory_num, $cur_link, $cur_category, $navi_switch, $accordion; return { fInit: function () { $cotegory_num = $('body').attr('data-oab-category'); $cur_link = '.js_oab_navi_'; $cur_category = '.js_oab_navi_category'; $navi_switch = $('.js_oab_navi_switch'); $accordion = '.js_accordion'; $($cur_link + $cotegory_num).addClass('tp_cur').closest($cur_category).addClass('tp_cur tp_cur_border').children($accordion).show(); $navi_switch.off().on('click', function () { $(this).closest($cur_category).toggleClass('tp_cur').children($accordion).slideToggle(300); }); } }; }()); var $top_movie = (function () { 'use strict'; var $movie_switch, $movie_target, $mask, $init_flg = true; return { fInit: function () { $movie_switch = $('.js_top_movie_switch'); $movie_target = $('.js_top_movie_target'); $mask = $('.js_mask'); $movie_switch.on('click', function () { if ($init_flg === true) { $top_movie.fInitToggle(); } else { $top_movie.fToggle(); } }); $mask.on('click', function () { $top_movie.fToggle(); }); }, fToggle: function () { $movie_target.stop().fadeToggle(300); $mask.stop().fadeToggle(300); }, fInitToggle: function () { $movie_target.hide().css('z-index', 1110); $init_flg = false; $top_movie.fToggle(); } }; }()); //slide var $slide = (function () { 'use strict'; var $slide_target, $slide_option, $patient_slide, $patient_slide_num, $doctor_slide, $doctor_slide_num, $slide_wrap, $cur_slide, $pos_value, $slide_pager01, $slide_pager02, $slide_pager_wrap, $slide_pager_cur; return { fInit: function () { $patient_slide = $('.tp_patient_slide'); $doctor_slide = $('.tp_doctor_slide'); $patient_slide_num = $patient_slide.find('.tp_patient_slide_part').length; $doctor_slide_num = $doctor_slide.find('.tp_patient_slide_part').length; $slide_target = $('.js_slide'); $slide_option = { slide: { touchMove: false, dots: true, dotsClass: 'tp_slide_dots js_slide_dots', prevArrow: '
', nextArrow: ' ' } }; $slide_target.slick($slide_option.slide); $slide_pager01 = ' '; $slide_pager02 = ' '; $patient_slide.find('.js_slide_dots').append($slide_pager01); $doctor_slide.find('.js_slide_dots').append($slide_pager02); }, fSlideAfter: function ($target) { $slide_wrap = $target.closest('.js_slide'); $cur_slide = $slide_wrap.find('.slick-current'); $pos_value = 5 + $cur_slide.find('.js_slide_title').outerHeight() + $cur_slide.find('.js_slide_img').outerHeight(); $slide_wrap.find('.js_slide_dots').css('top', $pos_value + 'px'); $slide.fPager(); }, fSlideBefore: function () { $slide_wrap = $('.js_slide'); $slide_wrap.each(function () { $cur_slide = $(this).find('.slick-current'); $pos_value = 5 + $cur_slide.find('.js_slide_title').outerHeight() + $cur_slide.find('.js_slide_img').outerHeight(); $(this).find('.js_slide_dots').css('top', $pos_value + 'px'); }); }, fPager: function () { $slide_pager_wrap = $('.js_slide_dots'); $slide_pager_wrap.each(function () { $slide_pager_cur = $(this).find('.js_slide_pager_cur'); $(this).children('li').each(function ($num) { if ($(this).hasClass('slick-active')) { $slide_pager_cur.text($num + 1); } }); }); } }; }()); var $uui_check = (function () { 'use strict'; var $check_box, $check_box_icon, $check_value, $click_num, $print_link, $rewrite_link; return { fCheck: function ($target) { $click_num = Number($target.attr('data-value')); if ($target.children($check_box_icon).hasClass('tp_cur')) { $check_value[$click_num] = 1; } else { $check_value[$click_num] = 0; } $uui_check.fRewrite(); }, fRewrite: function () { $rewrite_link = '/print/print.html?sec=message&q1=' + $check_value[0] + '&q2=' + $check_value[1] + '&q3=' + $check_value[2] + '&q4=' + $check_value[3]; $print_link.attr('href', $rewrite_link); }, fInit: function () { $check_box = $('.js_check_box'); $print_link = $('.js_print_link'); $check_box_icon = '.js_check_box_icon'; $check_value = [0, 0, 0, 0]; $uui_check.fRewrite(); $check_box.off().on('click', function () { $(this).children($check_box_icon).toggleClass('tp_cur'); $uui_check.fCheck($(this)); }); } }; }()); var $self_check = (function () { 'use strict'; var $check_box, $select_wrap, $cur_target, $check_flg, $check_value, $check_q, $check_point, $result_btn, $total, $result_target, $result_point, $result_text, $result_text_target, $caution_target, $caution_text, $rewrite_link, $print_link, $link_result; return { fRewrite: function () { $rewrite_link = '/print/print.html?sec=selfcheck&q1=' + $check_value[0] + '&q2=' + $check_value[1] + '&q3=' + $check_value[2] + '&q4=' + $check_value[3] + '&result=' + $link_result; $print_link.attr('href', $rewrite_link); }, fTotal: function ($target) { $check_q = Number($target.closest($select_wrap).attr('data-q')); $check_point = Number($target.parent().attr('data-point')); $check_flg[$check_q] = true; $check_value[$check_q] = $check_point; }, fResult: function () { $total = $check_value[0] + $check_value[1] + $check_value[2] + $check_value[3]; if ($check_flg[0] === true && $check_flg[1] === true && $check_flg[2] === true && $check_flg[3] === true) { if ($check_value[2] < $check_value[3]) { $caution_text.empty().append($result_text[6]); $result_target.slideUp(300); $caution_target.slideDown(300); } else { $result_text_target.empty(); if ($total === 0) { $link_result = 0; $result_text_target.append($result_text[0]); } else if ($check_value[2] < 2 || 3 > $total) { $link_result = 1; $result_text_target.append($result_text[1]); } else if ($check_value[2] > 0 && $total > 2 && 6 > $total) { $link_result = 2; $result_text_target.append($result_text[2]); } else if ($check_value[2] > 0 && $total > 5 && 12 > $total) { $link_result = 3; $result_text_target.append($result_text[3]); } else if ($check_value[2] > 0 && $total > 11) { $link_result = 4; $result_text_target.append($result_text[4]); } else if ($check_value[2] === 1 && $check_value[3] === 1 && ($check_value[0] + $check_value[1]) > 4) { $link_result = 1; $result_text_target.append($result_text[1]); } $caution_target.slideUp(300); $result_target.slideDown(300); } } else { $caution_text.empty().append($result_text[5]); $result_target.slideUp(300); $caution_target.slideDown(300); } $result_point.text($total); $self_check.fRewrite(); }, fInit: function () { $check_box = $('.js_check_box'); $select_wrap = '.js_select_wrap'; $cur_target = '.js_cur_target'; $check_flg = [false, false, false, false]; $check_value = [0, 0, 0, 0]; $result_btn = $('.js_result_btn'); $result_target = $('.js_result_target'); $result_point = $('.js_result_point_target'); $result_text_target = $('.js_result_text'); $result_text = [ '特に問題ないと考えられます。', '過活動膀胱ではない可能性が高いです。