Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

True visual analogue scales in Limesurvey?

More
6 years 10 months ago #156256 by de_huig
Replied by de_huig on topic True visual analogue scales in Limesurvey?
That's perfect! Thank you so much!
The topic has been locked.
More
3 years 11 months ago - 3 years 11 months ago #200198 by mopodendo
Replied by mopodendo on topic True visual analogue scales in Limesurvey?
Sorry for bringing this up once more.
I tried tpartner's last JS solution on LS 3.17 but it doesn't seem to work. Is there a way to achieve a hiding of the tooltip and the slider handle with this version?

To specify: If I include the code, the slider is completely hidden and no answer can be given.
Last edit: 3 years 11 months ago by mopodendo.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #200204 by tpartner
Replied by tpartner on topic True visual analogue scales in Limesurvey?
There are several code snippets in this thread. Can you please explain exactly what you wish to achieve with screenshots/mock-ups and post the code that you tried?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
3 years 11 months ago #200207 by mopodendo
Replied by mopodendo on topic True visual analogue scales in Limesurvey?
Sure!
Screenshot is the current state.
1. I would like the tooltip (black box displaying the input number) to disappear
2. Ideally, although not as inportant, the selection marker (circle) would only appear once the participant has clicked on the slider.
Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $('#question{QID} .question-item').hide();
 
    $('#question{QID} input[type="text"]').each(function(i) {
      $('#question{QID} input[type="text"]').on('slideEnabled', function(e) {
        var thisRow = $(this).closest('.question-item');
        $('.slider .tooltip', thisRow).addClass('hidden');
        $('.slider .slider-handle', thisRow).hide();
 
        $('.slider', thisRow).on('slideStop', function(e) {
          $('.slider-handle', thisRow).show();
        });
 
        $(thisRow).show();
      });
    });
  });
</script>

Thanks for your help!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago - 3 years 11 months ago #200218 by Joffm
Replied by Joffm on topic True visual analogue scales in Limesurvey?
Hi,
only to hide the tooltip, this should be sufficient.
Code:
.slider .tooltip.top {
  display:none;
}


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 11 months ago by Joffm.
The following user(s) said Thank You: mopodendo
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #200222 by tpartner
Replied by tpartner on topic True visual analogue scales in Limesurvey?
This script will remove the tooltips and hide the slider handle until the slider is manipulated in 3.x:

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var qID = {QID};
    var thisQuestion = $('#question'+qID);
 
    $('input:text', thisQuestion).on('slideEnabled',function(){ 
      var thisItem = $(this).closest('li');
      var thisCode = $(thisItem).attr('id').split('X'+qID)[1];
 
      // Remove the tooltips
      $('.tooltip', thisItem).remove();
 
      // Initially hide the slider handle
      if($('input:text[id^="answer"][id$="X'+qID+thisCode+'"]', thisItem).val() == '') {
        $('.slider-handle', thisItem).hide();
      }
 
      // Listener on slider
      $(this).on('slide slideStop', function(event) {
        // Show the slider handle
        $('.slider-handle', thisItem).show();
      });
    });
    });
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...9381.lss
File Size:24 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: mopodendo
The topic has been locked.
More
3 years 11 months ago #200225 by mopodendo
Replied by mopodendo on topic True visual analogue scales in Limesurvey?
Perfect, thanks a lot!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose