I am working on a mobile friendly accordion style matrix question and the UI for the first 3 statement options auto collapses the accordion to show the next statement. How do I achieve the same effect for the 4th and final statement before the user would continue to the next question?
Solved
How to cause last accordion in mobile friendly matrix to auto close upon answer selection?
Best answer by ChiragK
Hi Jared, Try adding this JavaScript code in that question.
Qualtrics.SurveyEngine.addOnReady(function () {
var $this = jQuery(this.questionContainer);
var isMobile = jQuery(".QuestionBody", $this).is(".mobile");
jQuery(".ChoiceRow input[id][name]", $this).on("change", function () {
if (isMobile && jQuery(this).closest(".ChoiceRow").nextAll(".ChoiceRow").length === 0) {
jQuery(this).closest(".ChoiceRow").find("th[id]").click();
}
});
});
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.