Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var interval;
- var seconds = 30;
- function MostrarPerguntaPorZona(lat, long, dif) {
- $.ajax({
- url: '/Pergunta/GetRandomByZona',
- data: { latitude: lat, longitude: long, dificuldade: dif },
- datatype: "json",
- success: function (data) {
- $('#perguntaID').val(data.PerguntaId);
- $('#zonaNome').text(data.ZonaNome);
- $('#pergundaDescricao').text(data.Descricao);
- $('#Resposta1Descricao').text(data.Hipotese1Descricao);
- $('#Resposta2Descricao').text(data.Hipotese2Descricao);
- $('#Resposta3Descricao').text(data.Hipotese3Descricao);
- $('#Resposta4Descricao').text(data.Hipotese4Descricao);
- $("#PerguntaImagem").attr("src", data.Imagem);
- $("#AjudaPergunta").text(data.AjudaPergunta);
- /*if(data.Conq == 1)
- alert('Esta zona ja foi conquistada! Continua a explorar.');
- else {
- $('#myModal').modal('toggle');
- }*/
- }
- });
- $('#myModal').modal('toggle');
- seconds = 30;
- interval = setInterval(function () {
- var el = $("#timer");
- if (seconds == 0) {
- clearInterval(interval);
- el.html('0:00');
- $('#myModal').modal('hide');
- seconds = 30;
- } else {
- seconds--;
- el.html(seconds);
- }
- }, 1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement