Slider questions customisation

jaegtizjaegtiz SwitzerlandCommunity Member - Trial User Qubie ✭

Slider questions customisation

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:


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 = {

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!


Best Answer

  • NiCNiC Mumbai Superuser ✭✭✭✭
    Accepted Answer

    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.


Sign In to Comment