Welcome, Guest
Username: Password: Remember me

TOPIC: Slider Scale

Slider Scale 3 years 3 months ago #55286

  • Mike1985
  • Mike1985's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Karma: 0
Hi.

In my slider I have two "options" at either end of the scale. On the left of the scale I have 'vegetables' and on the right I 'meat' (example). The scale runs from -100 (that's 'vegetables') to 100 (that's 'meat') and the starting position of the 'slider' is 0 (in the middle).

When I start moving the slider toward vegetables, the number above the slider has a minus "-" sign in front of it. Is there a way to get rid of this - either in a Javascript file somewhere, a line in the quanda.php or do I maybe just need to design the question differently???

Please please please help : )
The administrator has disabled public write access.

Re: Slider Scale 3 years 3 months ago #55289

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
I think you should just design the question differently. The slider always shows the current value and if it is negative, a "-" is added.

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.

Re: Slider Scale 3 years 3 months ago #55310

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
You could force display of the absolute value by modifying scripts/jquerylime-slider.js,

Change lines 53 and 61 from:
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + thevalue + slider_suffix);

To:
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + Math.abs(thevalue) + slider_suffix);

Note that this would affect all surveys and be prone to being overwritten when updating.
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.
Last Edit: 3 years 3 months ago by tpartner.
The administrator has disabled public write access.

Re: Slider Scale 3 years 2 months ago #55379

  • Mike1985
  • Mike1985's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Karma: 0
Thank you. I'll give it a go. This won't affect the number that's passed to the database though will it? I'd just want it to change on the web page..

Mike
The administrator has disabled public write access.

Re: Slider Scale 3 years 2 months ago #55388

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
When using such a Javascript workaround the code simply removes some HTML elements when displaying the page. This does not affect how data is stored at the DB.

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.

Re: Slider Scale 3 years 2 months ago #55730

  • Mike1985
  • Mike1985's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Karma: 0
Thanks guys. Really appreciate your help.

I am currently trying to get financial approval to donate to you guys but in the meantime maybe I could provide you with some code or something? My colleague has developed a survey redirection page so that when someone enters their unique staff number, they are directed to the survey we want them to fill in...

Also, we have just bought Fusion Charts and are incorporating it in to LimeSurvey. Perhaps we could document that and let you have any code that bridges the two applications...

Mike
The administrator has disabled public write access.

Re: Slider Scale 3 years 2 months ago #55868

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
Mike1985 wrote:
Thanks guys. Really appreciate your help.

I am currently trying to get financial approval to donate to you guys but in the meantime maybe I could provide you with some code or something? My colleague has developed a survey redirection page so that when someone enters their unique staff number, they are directed to the survey we want them to fill in...

Also, we have just bought Fusion Charts and are incorporating it in to LimeSurvey. Perhaps we could document that and let you have any code that bridges the two applications...

Mike
Both sounds promising...

1. Can you explain the redirect in more detail?

2. We won't be able to add the Fusion Charts if this addon has to be bought but a nice documentation on how to inegrate this would be nice to be put at the workaround section.

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.
Moderators: ITEd
Time to create page: 0.129 seconds
Donation Image