Commit 88e4d8b8 by doszhang

dos

parent 5d3b14fd
...@@ -74,7 +74,9 @@ $(document).ready(function () { ...@@ -74,7 +74,9 @@ $(document).ready(function () {
//答案选中 //答案选中
$('.answer').on('click', chooseAnswer); $('.answer').on('click', chooseAnswer);
//下一题 //下一题
$('.btn-nextquestion').on('click', nextQuestion); $('.btn-nextquestion').on('click', {
source: 'btn'
}, nextQuestion);
...@@ -107,12 +109,13 @@ $(document).ready(function () { ...@@ -107,12 +109,13 @@ $(document).ready(function () {
} }
//右滑 //右滑
else if (X < 0) { else if (X < 0) {
console.log('右滑'); nextQuestion('indexbar');
} }
}); });
}); });
function nextQuestion() { function nextQuestion(e) {
let source = e.data.source;
if (nowAnswer !== '') { if (nowAnswer !== '') {
answerArr[nowQuestionIndex - 1] = nowAnswer; answerArr[nowQuestionIndex - 1] = nowAnswer;
nowAnswer = ''; nowAnswer = '';
...@@ -129,9 +132,11 @@ function nextQuestion() { ...@@ -129,9 +132,11 @@ function nextQuestion() {
$('.question' + nowQuestionIndex + '-block').show(); $('.question' + nowQuestionIndex + '-block').show();
}, 900); }, 900);
} else { } else {
$('#notification_area').remove(); if (source == 'btn') {
my_notify('请选择答案'); $('#notification_area').remove();
return false; my_notify('请选择答案');
return false;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment