Skip to content

Instantly share code, notes, and snippets.

@marketinview
Last active October 23, 2022 15:21
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/37766e9e0f2f9d434845d327f1ece188 to your computer and use it in GitHub Desktop.
Save marketinview/37766e9e0f2f9d434845d327f1ece188 to your computer and use it in GitHub Desktop.
Qualtrics: Initialize Graphic Slider. Script initializes graphic slider to a specified value. Supports previous button. #qualtrics #js #jq #initialize #slider #graphic
Qualtrics.SurveyEngine.addOnReady(function() {
//Initialize graphic slider
var init = "1"; //update to initial graphic to show
var qid = this.questionId;
var q = jQuery("#"+qid);
if(q.find('.SSTrack.activated').length == 0) { //not already set (support previous button)
q.find('.handle').css("top", "100px"); //initialize slider
q.find(".SSImage>.SSImage:visible").hide(); //hide default graphic
jQuery(("#Image_QR~"+qid+"@"+init).replace(/(~|@)/g, "\\$1")).show(); //show init graphic
}
});
@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