How can I hide the anchor on a sliding scale question? | XM Community
Solved

How can I hide the anchor on a sliding scale question?


I need something to hide the anchor on the sliding scale question BEFORE the question is answered. The anchor can appear after the question has been answered. How can I do this?
icon

Best answer by Michael_Campbell_RedPepper 26 March 2018, 22:52

View original

10 replies

Userlevel 4
Badge +3
Hmm.. I'm not sure I know what you're talking about. Could you include a screenshot?
!

Thanks for the question! Please see image attached.
Userlevel 4
Badge +3
I see! Are you familiar with Javascript? There is code for that. It's a little tricky, but not impossible!
I am familiar with copy and pasting Javascript and simple manipulation with coding ... does that count? 😛
Userlevel 4
Badge +3
Heck yeah!! Here is some code that I spun up really quickly for you!

```
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
const PREREQ_SELECTOR = '#QID1 > div.Inner.BorderColor.MAVR > div > fieldset > div > ul';
const SLIDER_SELECTOR = 'QID6~1~handle';

const PREREQ = $(PREREQ_SELECTOR);
const SLIDER = $(SLIDER_SELECTOR);

console.log(SLIDER);

console.log('Hiding Slider');
SLIDER.hide();

PREREQ.click(() => {
console.log('Showing Slider');
SLIDER.show();
})

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});
```

Put this in the Slider's JS panel. The PREREQ_ID is the Selector of the *List* of items that are selectable.

SLIDER is the Selector of the, well, the Slider haha.

Here is a _crude_ screenshot of how to select the *List* item.. Sorry, I don't have the tools to make fancy ones :)

!
Hi Michael,

I think I did it right, but for some reason, my anchors are still showing ... maybe I am not as good as copying and pasting as I thought?

Does it have anything to do with my question not being Q2? Does this work if I have multiple sliding scale in the same question? (It did not when I tried to copy the code ...)

!

!
Userlevel 7
Badge +27
Sorry to horn in, but I think the attached would be easier. You can change "click" to "mouseover" if you don't want to make the respondent click to make the handle appear before dragging.
Userlevel 2
Badge +1
Hi everyone,

Apologies for reviving an older post. @TomG, I tried your helpful suggestion and it worked for me, but I was wondering if by any chance there was a way to have the handle appear on whichever spot the respondent first clicked, rather than at the leftmost corner?

I had the same question as the person who originally asked this (https://www.qualtrics.com/community/discussion/932/no-default-on-graphic-sliders-sliders-in-general#latest) and we're worried that if there is no handle visible at first, but when the person clicks on the slider it appears in the leftmost corner, there'll still be an issue with anchoring the respondent to the leftmost corner of the slider and that they won't sufficiently adjust away from it when responding. It'd be super helpful if the handle could appear on the value the person first clicked on the slider, if that makes sense. Thanks!
Userlevel 7
Badge +27
@DRRTGCC - Yes, you could have the handle appear where the respondent clicked, but the JavaScript to do it would be MUCH more complicated.
Hi There!

Another newbie here. Is it possible to have grid lines to be shown on slider bar?

Thanks.

Leave a Reply