Grid 2 questions on mobile

Hello Zachary,

I tested this code on a grid question, it works perfectly. However, when a respondent answers the questionnaire on a cell phone, he is blocked on the first grid. How to adapt the code to be compatible on mobile? Thanks !

Best,

Sylvain


[js]
<script type="text/javascript">
$(document).ready(function(){
// Move items from the second grid to the first
var rows = $('#GridQ1_div > .question_body > table > tbody > tr').length;
for (var row = 1; row <= rows; row++)
{
var endTd = '#GridQ1_div > .question_body > table > tbody > tr:nth-child(' + row + ') > td:last-child';
var secondTd = '#GridQ2_div > .question_body > table > tbody > tr:nth-child(' + row + ') > td:nth-child(2)';

$(secondTd).insertAfter(endTd);
$(secondTd).insertAfter(endTd);
}

// Tidy up
$('#GridQ2_div').hide();
$('#GridQ1_div td').attr('width', '20%');
})
</script>
[/js]

Each "GridQ1" and "GridQ2" in the code will need to be replaced with the names of the two grid questions.

12 replies