Have an idea?

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

Values cannot be seen on mobile device

Hi Zachary,

You provided the following code, where I can put left and right values to sliders. However, these values do not appear when I do the service on a mobile device. Any idea how to fix this?

<script>
$(document).ready(function(){
    $('#[% QuestionName() %]_div .inner_table > tbody > tr > td:last-child').each(function(){
        if ($(this).hasClass('col_label_cell')) {
            $(this).before('<td></td>');
            $(this).after('<td></td>');
        }
        else {
            $(this).before('<td>5K&nbsp;€</td>');
            $(this).after('<td>40K&nbsp;€</td>');
        }
    });
})
</script>
asked Jun 22, 2020 by anonymous

1 Answer

0 votes
Please try this modification instead:

<style>
.sliderTable,
.sliderTable > tbody > tr > td:nth-child(2) {
    width: 100%;
}

.sliderTable > tbody > tr > td:first-child {
    padding-right: 20px;
}

.sliderTable > tbody > tr > td:last-child {
    padding-left: 20px;
}
</style>

<script>
$(document).ready(function(){
    $('.slider').wrap('<table class="sliderTable"><tbody><tr><td></td></tr></tbody></table>');
    $('.sliderTable > tbody > tr').prepend('<td>start</td>');
    $('.sliderTable > tbody > tr').append('<td>end</td>');
})
</script>
answered Jun 22, 2020 by Zachary Platinum Sawtooth Software, Inc. (192,600 points)
...