- Posts: 2
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); var answersLength = $('tr.answers-list:eq(0) td.answer-item', thisQuestion).length; // Insert new rows $('th.answertext', thisQuestion).each(function(i){ $(this).closest('tr.answers-list').before('<tr class="inserted-row">\ <th></th>\ <td class="image-cell" colspan="'+answersLength+'"></td>\ </tr>'); // Move the images $(this).closest('tr.answers-list').prev('.inserted-row').find('.image-cell').append($('img', this)); }); // Some styles... $('.inserted-row img', thisQuestion).css({ 'max-width': '400px', 'hieght': 'auto' }); $('label.hide', thisQuestion).css({ 'left': 'auto', 'top': 'auto', 'position': 'relative', 'display': 'block' }); $('thead', thisQuestion).css({ 'display': 'none' }); $('tr.answers-list', thisQuestion).css({ 'background-color': '#EEEEEE' }); $('th.answertext', thisQuestion).css({ 'background-color': '#FFFFFF' }); }); </script>
tpartner wrote: You can:
1) Place the images in the array sub-questions.
2) Assign an answer width of 0 to the question.
3) Add a script like this to the question source. The script will insert new table rows and move the images.