Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Semantic question - Dragging the slider to end

Hi,

I have a semantic question and couldn't drag all the way to the right or left. The scale actually sits at the far end. Is there any solution to make it go all the way to the end?
asked Oct 29, 2018 by Abdul Bronze (2,255 points)

1 Answer

0 votes
Please try adding this script to your semantic diff to shift the leftmost and rightmost points to the ends of the sliders:

<script>
function SSI_FindSliderListValue(intPosValue, AnchorPoints, intMax, ui)
{
    var i = 0;
    var intLeftBound = 0;
    var intRightBound = 0;
    var intListValue = 0;
    intPosValue = SSI_RoundNumber((intPosValue / intMax) * 100, 1);
    for (i = 0; i < AnchorPoints.length; i++)
    {
        intLeftBound = AnchorPoints[i][0];
        intRightBound = AnchorPoints[i][1];
        intListValue = 0;
        if (intPosValue >= intLeftBound && intPosValue <= intRightBound)
        {
            intPosValue = SSI_GetHandleCenterPoint(AnchorPoints, intLeftBound, intRightBound, intPosValue, ui.handle);
            intListValue = AnchorPoints[i][2];
            break;
        }
    }
    switch (intListValue) {
        case 1:
            intPosValue = 1;
            break;
        case AnchorPoints.length:
            intPosValue = 1000;
            break;
    }
    return [intListValue, intPosValue];
}

function SSI_FindSliderPosition(intValue, AnchorPoints, intMax, SliderObj)
{
    var i = 0;
    var intPosValue = 0;
    for (i = 0; i < AnchorPoints.length; i++)
    {
        intLeftBound = AnchorPoints[i][0];
        intRightBound = AnchorPoints[i][1];
        intListValue = AnchorPoints[i][2];
        if (intValue == intListValue)
        {
            intPosValue = SSI_GetHandleCenterPoint(AnchorPoints, intLeftBound, intRightBound, intValue, jQuery(SliderObj).find(".ui-slider-handle"));
        }
    }
    switch (intValue) {
        case 1:
            intPosValue = 1;
            break;
        case AnchorPoints.length:
            intPosValue = 1000;
            break;
    }
    return intPosValue;
}
</script>


Note that this script is not compatible with column randomization.
answered Oct 29, 2018 by Zachary Platinum Sawtooth Software, Inc. (120,175 points)
Thank you so much Zachary.
...