User Tools

Site Tools


forceaccordion

This is an old revision of the document!


forceAccordion - Force mobile matrix accordion format on all screen sizes

The forceAccordion function forces use of the mobile matrix accordion formatting on all screen sizes.

  • Full expand, collapse, and auto-collapse functionality
  • Supports screen resizing
  • Compatible with the likertHighlightUnanswered function

Here is a quick video demonstration:

Set-up Instructions

Add Function To Survey

To make the function available to all page/questions in the survey, copy the function to the Survey Header inside a script tag: Add the forceAccordion function to the survey header to make it available to any page/question in the survey. Go to Look & Feel → General → Header edit → and paste the provided forceAccordion function JS:

<script>/*Paste forceAccordion function JS here*/</script>

Alternatively, paste the forceAccordion function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.

JavaScript Function Call

Add JS to call the forceAccordion function from the likert matrix question as follows:

Qualtrics.SurveyEngine.addOnload(function() {
	forceAccordion(this);
});

To use in conjunction with the likertHighlightUnanswered function use this JS:

Qualtrics.SurveyEngine.addOnload(function() {
	forceAccordion(this);
	var qobj = this;
	setTimeout(function() { likertHighlightUnanswered(qobj); },200);
});
forceaccordion.1637241139.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki