diff --git a/php/js/triviatime.js b/php/js/triviatime.js new file mode 100644 index 0000000..4dccfaf --- /dev/null +++ b/php/js/triviatime.js @@ -0,0 +1,30 @@ +var createModalDiv = function() { + if($('#infoModal').length == 0) { + $('body').append('' + + ''); + } +}; +$(function() { + $(".modal-table > tbody > tr").click(function() { + createModalDiv(); + var headers = $(this).parent("tbody").parent("table").find('th'); + var values = $(this).children("td"); + var content = ''; + for(var i=0;i"; + content += "

" + values.eq(i).text() + "

"; + } + $('#infoModal > .modal-body').html(content); + $('#infoModal').modal('show'); + }); +}); \ No newline at end of file