Welcome, Guest
Username: Password: Remember me

TOPIC: Hiding slider handle by default until user clicks on slider

Hiding slider handle by default until user clicks on slider 3 years 4 months ago #77886

Hi,

Does anyone know how to do that (using multiple numerical input question)?

I actually did find a solution here, but I have no idea what the code means or what to do with it (where do I put it? needs additional coding?)

I'd appreciate any help,
David
The administrator has disabled public write access.

Hiding slider handle by default until user clicks on slider 3 years 4 months ago #77890

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5029
  • Thank you received: 1038
  • Karma: 433
Add the following to the end of template.js:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() { 
 
		$('.ui-slider-handle').hide();
 
		$('.ui-slider').mousedown(function(){
			$('.ui-slider-handle', this).show();
		});
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Hiding slider handle by default until user clicks on slider 3 years 4 months ago #77894

Thanks so much!

It didn't work when I added it to template.js, but it did work when I added it to the question itself.
The administrator has disabled public write access.

Hiding slider handle by default until user clicks on slider 3 years 4 months ago #77923

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5705
  • Thank you received: 331
  • Karma: 255
davidspivak wrote:
Thanks so much!

It didn't work when I added it to template.js, but it did work when I added it to the question itself.
When using the <script> tag, the code always has to be added at the question. Also see this tutorial on how to use Javascript at Limesurvey.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Hiding slider handle by default until user clicks on slider 3 years 4 months ago #77945

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5029
  • Thank you received: 1038
  • Karma: 433
It didn't work when I added it to template.js, but it did work when I added it to the question itself.
Oop, sorry, I shouldn't have included the <script> tags.

To use in template.js:
 
	$(document).ready(function() { 
 
		$('.ui-slider-handle').hide();
 
		$('.ui-slider').mousedown(function(){
			$('.ui-slider-handle', this).show();
		});
	});
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.155 seconds