Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active March 6, 2024 16:02
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/57868fad9dff80bd02c179b6769973e9 to your computer and use it in GitHub Desktop.
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
<span class="exclusive">Scale Point Label</span>
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