modx-pro / Tickets

Tickets system for MODX Revolution
35 stars 52 forks source link

Затухание коментов с плохим рейтингом #59

Closed gaserge closed 10 years ago

gaserge commented 10 years ago

добавить js:

$('#comments-wrapper .ticket-comment').each(function (i) {
     var count = parseInt( $(this).find('.ticket-comment-rating .rating').html() );
      if( count <= -5 ) {
        $(this).find('.ticket-comment-text').addClass('bad');
     }
});

добавить css

.ticket-comment-text.bad { -moz-transition: all 0.5s ease-out; -o-transition: all 0.5s ease-out; -webkit-transition: all 0.5s ease-out; transition: all 0.5s ease-out;

opacity: 0.2;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=20);
-moz-opacity: 0.2;
-khtml-opacity: 0.2;

} .ticket-comment-text.bad:hover{ -moz-transition: all 0.5s ease-out; -o-transition: all 0.5s ease-out; -webkit-transition: all 0.5s ease-out; transition: all 0.5s ease-out;

opacity: 1;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
-moz-opacity: 1;
-khtml-opacity: 1;

}

bezumkin commented 10 years ago

По моему, это лучше делать через php + css, как на Хабре:

.comments_list .comment_item .message.bad{
  -moz-transition: opacity 1s ease;
  -o-transition: opacity 1s ease;
  -webkit-transition: opacity 1s ease;
}
.comments_list .comment_item .message.bad5 { opacity: 0.2;background:#fff;  }
.comments_list .comment_item .message.bad4 { opacity: 0.35;background:#fff; }
.comments_list .comment_item .message.bad3 { opacity: 0.5;background:#fff;  }
.comments_list .comment_item .message.bad2 { opacity: 0.65;background:#fff; }
.comments_list .comment_item .message.bad1 { opacity: 0.8;background:#fff;  }
.comments_list .comment_item .message.bad:hover{opacity:1;}