// 念のため if(typeof jQuery=="undefined"){ document.write(""); } //外部でグローバル変数gtagIDreviewを宣言しておく必要あり 'UA-80213695-1' // window.dataLayer = window.dataLayer || []; //function gtag_review_touche(){dataLayer.push(arguments);} //gtag_review_touche('js', new Date()); //gtag_review_touche('config', gtagIDreview); // 長いコメントを展開 (古いjqueryだとon-clickイベントで動かないので注意) $('.customers_review_comment_btn').click(function(){ var p = $(this).parent().parent(); p.find('.customers_review_comment').hide(); p.find('.customers_review_raw').show(); $(this).hide(); var pp = p.parent(); var star = pp.find('.customers_review_star').text(); if( (typeof gtag)=="function" ){ // gtag_review_touche('event', 'occured-page:'+ location.href , {'event_category':'comment_expand', 'event_label': 'star:' + star, 'non_interaction': true }); gtag('event', 'occured-page:'+ location.href , {'event_category':'comment_expand', 'event_label': 'star:' + star, 'non_interaction': true }); } }); // レビュースクロールアニメーション var current_review_box_idx = 0; var settimeout_handle = 0; function move_review_box(up_or_down){ if(up_or_down==0){ current_review_box_idx++; if( current_review_box_idx >= $('.customers_review_box').length){ current_review_box_idx = 0; } }else{ current_review_box_idx--; if( current_review_box_idx < 0){ current_review_box_idx = $('.customers_review_box').length - 1; } } var next_pos_x = $('.customers_review_box').eq(current_review_box_idx).position().top * (-1); $('.customers_review_boxes').stop(true,false).animate({top:next_pos_x + 30 }, 1000); settimeout_handle = setTimeout('move_review_box(0)', 6000); } settimeout_handle = setTimeout('move_review_box(0)', 10000); //戻る $('.customers_review_ctrl_back').click(function(){ clearTimeout(settimeout_handle); move_review_box(-1); if( (typeof gtag)=="function" ){ // gtag_review_touche('event', 'occured-page:'+ location.href , {'event_category':'review_slide', 'event_label': 'move:back', 'non_interaction': true }); gtag('event', 'occured-page:'+ location.href , {'event_category':'review_slide', 'event_label': 'move:back', 'non_interaction': true }); } }); //次へ $('.customers_review_ctrl_next').click(function(){ clearTimeout(settimeout_handle); move_review_box(0); if( (typeof gtag)=="function" ){ // gtag_review_touche('event', 'occured-page:'+ location.href , {'event_category':'review_slide', 'event_label': 'move:next', 'non_interaction': true }); gtag('event', 'occured-page:'+ location.href , {'event_category':'review_slide', 'event_label': 'move:next', 'non_interaction': true }); } });