×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Влад Якуб
Added: Jul 24, 2020 4:36 PM
Views: 4477
Tags: no tags
  1. $spec_rating4 = (object)[];
  2. $spec_rating4->css = '
  3.                         row-title-transp                                                                                        {font-size:min(5vw, 25px)!important;}
  4.                         .pr-rows-group                                                                                                  {table-layout: fixed; width: 90%;}
  5.                         pr-question-main                                                                                        {margin-top:20px;}
  6.                         pr-elem-reminder                                                                                        {text-align:center; font-size:min(2.3vw, 18px); margin:auto; padding:10px;}
  7.                         pr-question-main x-pad                                                                          {text-align:center;}
  8.                         .pr-row-body:not(:only-child):hover, .pr-row-xtra:hover         {background: white;}
  9.                         .pr-rows-group  td                                                                                              {transition:0.3s;padding:5px;}
  10.                         .ch                                                                                                             {background: #b9deff!important;}
  11.                         .pr-rows-group  [cnum]:hover                                                                            {background: #b9deff;cursor:pointer;user-select:none;}
  12.                         @media(max-width:820px) {
  13.                                 pr-elem-reminder                        {padding:0;}
  14.                                 .pr-rows-group                                  {table-layout: fixed; width: 100%;}
  15.                                 .pr-rows-group                                  {width: 100%;font-size:80%;}
  16.                                 .pr-cell-head                           {width: 25%;}
  17.                         }';
  18. $spec_rating4->js = '
  19.                         $(function() {
  20.                                 $(".pr-cell-body").removeClass("none");
  21.                                 $(".pr-row-head").remove();
  22.                                 $("pr-elem").css({display:"none"});
  23.  
  24.                                 $(":radio").on("change", function() {
  25.                                         if( $(this).is(":checked") ) {
  26.                                                 $(this).closest("td").addClass("ch");
  27.                                         } else {
  28.                                                 $(this).closest("td").removeClass("ch");
  29.                                         }
  30.                                 });
  31.                         });
  32.                         $(function()
  33.                 {
  34.                     var arr = {};
  35.                                                 $("[rnum]").each(function()
  36.                                 {
  37.                                     arr[$(this).attr("rnum")] = $(this).find("pr-row-title").html();
  38.                                 });
  39.                                                 $(".pr-cell-head").remove();
  40.                                                 $("pr-question-header").after("<row-title-transp style=\"padding:0 25px;margin-top:50px;font-weight:bolder;font-size:160%;text-align:center;display:block;line-height:1.5em;user-select:none;\"><x-pad></x-pad></row-title-transp>");
  41.                                                 var _check_title_js = function() {
  42.                     $("[rnum]").each(function()
  43.                     {
  44.                         if( $(this)[0].offsetHeight != 0 )
  45.                             if( $("row-title-transp").html() != arr[$(this).attr("rnum")] )
  46.                                 $("row-title-transp").html( arr[$(this).attr("rnum")] );
  47.                     });
  48.                 }
  49.                                                 _check_title_js();
  50.                                                 var _int = setInterval(function() {
  51.                     _check_title_js();
  52.                 }, 150);
  53.                         });
  54.                         ';
  55.  
  56.                 'cols'  => [
  57.             1   => 'Совершенно НЕ согласен(а)',
  58.             2   => 'Скорее НЕ согласен(а)',
  59.             3   => 'Отчасти согласен(а), отчасти нет',
  60.             4   => 'Скорее согласен(а)',
  61.             5   => 'Полностью согласен(а)',
  62.             99  => 'Затрудняюсь ответить',
  63.         ],
  64.         'vtext'         =>      [
  65.             'r*c1'      => 'Совершенно НЕ согласен(а)',
  66.             'r*c2'      => 'Скорее НЕ согласен(а)',
  67.             'r*c3'      => 'Отчасти согласен(а), отчасти нет',
  68.             'r*c4'      => 'Скорее согласен(а)',
  69.             'r*c5'      => 'Полностью согласен(а)',
  70.             'r*c99'     => 'Затрудняюсь ответить',
  71.         ],
  72.         'rshuffle'  => true,
  73.         'fadein'    => 2,
  74.         'js'            =>      $spec_rating4->js.$gG->js->title_js,
  75.         'css'           =>      $spec_rating4->css.'row-title-transp {margin-top:15px!important;}',
  76.         'crepeat'       =>      100,
  77.