Slider questions customisation | XM Community
Skip to main content
Hi all



For a questionnaire I have different blocks with slider questions. In one block, I need the handle to appear only when people click on the track. This issue is already resolved: in the look and feel section the css code is:



.handle{

visibility:hidden;

}



and I added some javascript in the question part to make it appear again:



var q = jQuery("#"+this.questionId);

q.find(".track").on("click", function() {

jQuery(this).find(".handle").css('visibility', 'visible');

});





The problem that I have now is that in another block I need the the handle to be visible when the questions appears. I tried to reverse the css code and added to the javascript:

var styles = {



//.handle

handleClass: {

visibility: "visible"

}

}



Unfortunately, this didn't work. As I am not really a coder, my coding knowledge is quite limited. Does someone have a better idea how to resolve my problem?

Thanks in advance!
hi @jaegtiz

As you want your slider to appear like a normal slider for one question and customized for other i would suggest you rather use this code :

`var q = jQuery("#"+this.questionId);

q.find(".handle").css('visibility', 'hidden');

q.find(".track").on("click", function() {

jQuery(this).find(".handle").css('visibility', 'visible');

});`

for the question you need the slider hidden until the track is clicked.

And for the other you just have a normal slider question.

with this custom CSS , you were applying this css to all question that have a class handle (like the slider question)

`.handle{

visibility:hidden;

}`

so a custom js code specific to the question would be better.
Thank you very much for your answer!

Leave a Reply