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

Need help in creating a slider bar in qualtrics that is colored- going from red to green


Badge

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?

icon

Best answer by bgooldfed 23 May 2022, 07:54

View original

2 replies

Userlevel 5
Badge +25

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!

Badge

Thank you for the help!!

Leave a Reply