Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active October 23, 2022 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marketinview/11b25d460884f034d5286953698133cf to your computer and use it in GitHub Desktop.
Save marketinview/11b25d460884f034d5286953698133cf to your computer and use it in GitHub Desktop.
Qualtrics: Reverse Mobile Matrix Choices. Reverse the order of choices in a mobile (accordian) matrix question. Right to Left = Top to Bottom. #qualtrics #js #jq #matrix #mobile #scale #accordian #reverse
Qualtrics.SurveyEngine.addOnload(function() {
if(jQuery("#"+this.questionId+" .QuestionBody.mobile").length > 0) {
jQuery("#"+this.questionId+" tr.ChoiceRow").each(function() {
var label = jQuery(this).find("th");
jQuery(this).find("td").each(function(index) {
var choice = jQuery(this);
if(index > 0) {
label.after(choice);
if(choice.hasClass("last")) choice.removeClass("last");
}
else choice.addClass("last");
});
});
}
});
@marketinview
Copy link
Author

See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment