Need help in creating a slider bar in qualtrics that is colored- going from red to green | XM Community
Skip to main content

Need help in creating a slider bar in qualtrics that is colored- going from
red to green.
If you help with custom code for that.
Which part of the javascript I add custom code?

Hi sadhnav,
Add the following to the "onLoad()" function of your question:
Qualtrics.SurveyEngine.addOnload(function()
{
///*Place your JavaScript here to run when the page loads*/
jQuery(".track").css("background", "linear-gradient(to right, red, lightgreen)")
});
Alternatively you can just add the following to your custom CSS if you want it applied to all questions:
.track {
"background": "linear-gradient(to right, red, lightgreen)"
}
If you want to customise the colour gradient, you can read all about the linear-gradient function here: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient
Good luck!


Thank you for the help!!


Leave a Reply