Last active
October 23, 2022 15:21
-
-
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
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.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 | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php