Coding for visual differentiation between the rows of the matrix | XM Community
Skip to main content
Question

Coding for visual differentiation between the rows of the matrix

  • April 23, 2023
  • 2 replies
  • 54 views

Forum|alt.badge.img+2

Hello everyone,

Do you know if there is a way to visually differentiate the rows (i.e., statements or questions) in the matrix tables?

For example, create alternating dark and light lines, which could help the respondents distinguish between the different items/questions in the matrix.

Thank you so much 
 

2 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • April 23, 2023

Use the below code in the JS of matrix question:

var that = this;
jQuery("#"+this.questionId+" .q-matrix.desktop .ChoiceRow:even").css("background","#d6d6d6")
jQuery("#"+this.questionId+" .ChoiceRow").hover(function() {jQuery(this).css("background", "none");jQuery("#"+that.questionId+" .q-matrix.desktop .ChoiceRow:even").css("background","#d6d6d6");}, function() {jQuery("#"+that.questionId+" .q-matrix.desktop .ChoiceRow:even").css("background","#d6d6d6");});

 


CxEx
Level 5 ●●●●●
Forum|alt.badge.img+13
  • Level 5 ●●●●●
  • April 23, 2023