- Posts: 2
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<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>
.slider .tooltip.top { display:none; }
<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>