Welcome to the LimeSurvey Community Forum

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

Slider question/ position reset button

  • bierbier
  • bierbier's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago #221522 by bierbier
Slider question/ position reset button was created by bierbier
hey,
I'm trying to move the reset button in a Slider question right now. Unfortunately I have no success.
Does anyone have experience with this and can help me further? (LimeSurvey Version 5/ Fruity theme extension)

Many thanks in advance
Attachments:

Please Log in to join the conversation.

  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 5 months ago #221539 by tammo
Replied by tammo on topic Slider question/ position reset button
This is obviously a bug in the template. Please report this via bugs.limesurvey.org

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago - 2 years 5 months ago #221578 by tpartner
Replied by tpartner on topic Slider question/ position reset button
My preference would be to have the reset button below the slider so it doesn't interfere with the labels.

You can modify the core question view in your custom survey theme,  create a custom question theme or simply add a script like this to the question source:
 
 
Code:
<script type="text/javascript" data-author="Tony Partner">  
  $(document).on('ready pjax:scriptcomplete',function(){     
 
    $('#question{QID} .slider-item').each(function(i) { 
 
      $('.ls-input-group-reset', this).appendTo($('> div:eq(0)', this)).css({
        'display': 'block',
        'clear': 'both',
        'text-align': 'center',
        'padding-top': '10px',
        'width': 'auto'
      }); 
 
      $('.ls-input-group-reset button', this).css({
        'top': 'auto'
      });
    });
    });
</script>

 

Sample survey attached: 

File Attachment:

File Name: limesurvey...9374.lss
File Size:35 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 2 years 5 months ago by tpartner.
The following user(s) said Thank You: clestrie

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221589 by DenisChenu
Replied by DenisChenu on topic Slider question/ position reset button
> My preference would be to have the reset button below the slider so it doesn't interfere with the labels.

No way to use only CSS here ?
The button are inside is own div ? no ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221598 by tpartner
Replied by tpartner on topic Slider question/ position reset button

No way to use only CSS here ?

The button container is inside the slider wrapper. I suppose you could position the button wrapper absolutely but I prefer to move it to clear the labels, which are outside of the slider wrapper.

This is why I suggested that customizing the view is an alternative - moving the button wrapper and removing some dumb classes and styles.

Cheers,
Tony Partner

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

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago - 2 years 5 months ago #221615 by DenisChenu
Replied by DenisChenu on topic Slider question/ position reset button
With skelvanilla / 3.X
Code:
.ls-input-group-extra {
    /* width: 1%; */
    /* white-space: nowrap; */
    /* vertical-align: middle; */
    /* display: table-cell; */
    /* padding: 0.6rem 1.2rem; */
    /* line-height: 1; */
    display: block;
    margin-top: 3em;
    margin-left: 50%;
}

With console CSS editor
Not perfect but a start

 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 2 years 5 months ago by DenisChenu.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 5 months ago #221616 by DenisChenu
Replied by DenisChenu on topic Slider question/ position reset button
With
Code:
.ls-input-group-reset .btn-slider-reset{left:-25%}


 

The final issue is the margin-top:3em, must find an better solution maybe ?

I add it on new feature request in skel.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

More
1 year 10 months ago #229544 by clestrie
Replied by clestrie on topic Slider question/ position reset button
This solution works very well! With my survey I have to rename the button and I am biting my teeth at the solution. Is this possible and if so, how?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 10 months ago #229545 by tpartner
Replied by tpartner on topic Slider question/ position reset button
Please open new topics for new problems.

Place a script like this in the source of the question.

Code:
<script type="text/javascript" data-author="Tony Partner">  
 
  $(document).ready(function() {
    $('#question{QID} .ls-input-group-reset .btn-slider-reset').text('My button text');
  )};
</script>

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: clestrie, gressi

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose