How to show matrix as accordion on desktop | XM Community
Solved

How to show matrix as accordion on desktop

  • 10 April 2019
  • 5 replies
  • 109 views

Userlevel 1
Badge +2
Looking for some custom code (Java, CSS, or HTML) that would make grid questions (matrix) display in accordion style on a desktop similar to how it does on mobile -- where one attribute shows at a time and collapses once an answer is selected, causing the next attribute to open. I have scoured the board and the internet and have yet to find a solution.

Anyone have any ideas?
icon

Best answer by Shamji_Abbas 10 April 2019, 21:08

View original

5 replies

Badge +3
Hi @GeoffK,

Simply drag the vertical line present between the statements and scale point to the right as much as you can and this will give you a matrix in accordion style.
Userlevel 1
Badge +2
That was easy, thanks!

One follow up if by any chance you know. Do you by any chance know of code I could put into this question that could change the font for all the attributes (down the side of the matrix) (color = purple and font-weight = bold)....so I don't have to change each attribute individually with the Rich Content Editor?
Badge +3
> @GeoffK said:
> That was easy, thanks!
>
> One follow up if by any chance you know. Do you by any chance know of code I could put into this question that could change the font for all the attributes (down the side of the matrix) (color = purple and font-weight = bold)....so I don't have to change each attribute individually with the Rich Content Editor?

@GeoffK,

Add JavaScript to your question and paste the below code in the addOnReady function. This should give you the required output.
jQuery("#"+this.questionId+" .table-cell").css({"color":"purple","font-weight":"bold"});
Userlevel 1
Badge +2
Thank you! Worked like a charm.
Badge

Hi @GeoffK,

Simply drag the vertical line present between the statements and scale point to the right as much as you can and this will give you a matrix in accordion style.

Is this still working, please? It didn’t work for me

 

Leave a Reply