- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
I want to hide the slider handle by default until the user click on slider.
- ErtanErsan
- Topic Author
- Offline
- New Member
Less
More
4 years 6 months ago #189441
by ErtanErsan
I want to hide the slider handle by default until the user click on slider. was created by ErtanErsan
I want to hide the slider handle by default until the user click on slider. I found some script but doesn't work on Limesurvey 3.0.
This is the script i found:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('.ui-slider-handle').hide();
$('.ui-slider').mousedown(function(){
$('.ui-slider-handle', this).show();
});
});
</script>
Any help?
Thank you
This is the script i found:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('.ui-slider-handle').hide();
$('.ui-slider').mousedown(function(){
$('.ui-slider-handle', this).show();
});
});
</script>
Any help?
Thank you
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
4 years 6 months ago #189475
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic I want to hide the slider handle by default until the user click on slider.
Disable AJAX in the question theme options and add a script like this to the source of the question:
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); $('input:text', thisQuestion).on('slideEnabled',function(){ var thisItem = $(this).closest('li'); var thisSlider = $('.slider', thisItem); var answerInput = $('input:text.form-control', thisItem).not('[id$="slid"]'); // Hide the tooltip if no value for the slider if($(answerInput).val() == '') { $('.tooltip', thisSlider).hide(); } // Listener on slider $(this).on('slide slideStop', function(event) { $('.tooltip', thisSlider).show(); }); }); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- ErtanErsan
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
4 years 6 months ago #189570
by ErtanErsan
Replied by ErtanErsan on topic I want to hide the slider handle by default until the user click on slider.
Hi tpartner,
Thank you for your unswer. This works perfect
Thank you for your unswer. This works perfect
The topic has been locked.