Commit 88e4d8b8 by doszhang

dos

parent 5d3b14fd
......@@ -74,7 +74,9 @@ $(document).ready(function () {
//答案选中
$('.answer').on('click', chooseAnswer);
//下一题
$('.btn-nextquestion').on('click', nextQuestion);
$('.btn-nextquestion').on('click', {
source: 'btn'
}, nextQuestion);
......@@ -107,12 +109,13 @@ $(document).ready(function () {
}
//右滑
else if (X < 0) {
console.log('右滑');
nextQuestion('indexbar');
}
});
});
function nextQuestion() {
function nextQuestion(e) {
let source = e.data.source;
if (nowAnswer !== '') {
answerArr[nowQuestionIndex - 1] = nowAnswer;
nowAnswer = '';
......@@ -129,9 +132,11 @@ function nextQuestion() {
$('.question' + nowQuestionIndex + '-block').show();
}, 900);
} else {
$('#notification_area').remove();
my_notify('请选择答案');
return false;
if (source == 'btn') {
$('#notification_area').remove();
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