Last active
March 6, 2024 16:02
-
-
Save marketinview/57868fad9dff80bd02c179b6769973e9 to your computer and use it in GitHub Desktop.
Qualtrics: Carousel Exclusive Scale Points. Make scale point exclusive by placing its label inside an element with class "exclusive". #qualtrics #js #jq #carousel #exclusive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="exclusive">Scale Point Label</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
/* carouselExclusive.js */ | |
/* Thomas Gibbons Consulting (qualtricswiki.tgibbons.com) */ | |
var q = jQuery(this.questionContainer); | |
q.find(".exclusive").each(function() { | |
jQuery(this).closest(".CarouselAnswerButtonContainer").find("[type=checkbox]").addClass("exclusiveCB"); | |
}); | |
var cbs=q.find("[type=checkbox]"), exCbs=cbs.filter(".exclusiveCB"); | |
exCbs.click(function() { if(this.checked) cbs.not(this).prop("checked",false); }); | |
cbs.not(exCbs).click(function() { if(this.checked) exCbs.prop("checked",false); }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment