How to show matrix as accordion on desktop | XM Community
Skip to main content
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?
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.
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 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"});
Thank you! Worked like a charm.

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