Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
maf
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2d546abe
authored
Jan 13, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
51c0b793
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
Public/static/js/common.js
+27
-4
No files found.
Public/static/js/common.js
View file @
2d546abe
...
@@ -50,7 +50,12 @@ preloadimages(preloadImageList, function () {
...
@@ -50,7 +50,12 @@ preloadimages(preloadImageList, function () {
$
(
'.loading-page .progress'
).
css
(
'width'
,
(
16.6
/
100
)
*
(
progress
*
100
)
+
'rem'
);
$
(
'.loading-page .progress'
).
css
(
'width'
,
(
16.6
/
100
)
*
(
progress
*
100
)
+
'rem'
);
});
});
//当前用户题目索引
let
nowQuestionIndex
=
1
;
//当前题目用户选择答案
let
nowAnswer
=
''
;
//答案数组
let
answerArr
=
[];
//海报canvas
//海报canvas
let
posterCanvas
;
let
posterCanvas
;
...
@@ -65,14 +70,29 @@ $(document).ready(function () {
...
@@ -65,14 +70,29 @@ $(document).ready(function () {
$
(
'.home-page .btn-next'
).
on
(
'click'
,
showQuestion
);
$
(
'.home-page .btn-next'
).
on
(
'click'
,
showQuestion
);
//答案选中
//答案选中
$
(
'.answer'
).
on
(
'click'
,
chooseAnswer
);
$
(
'.answer'
).
on
(
'click'
,
chooseAnswer
);
//下一题
$
(
'.btn-nextquestion'
).
on
(
'click'
,
nextQuestion
);
});
});
function
chooseAnswer
(
e
)
{
function
nextQuestion
()
{
console
.
log
(
e
);
if
(
nowAnswer
!=
''
)
{
answerArr
.
push
(
nowAnswer
);
nowAnswer
=
''
;
}
else
{
$
(
'#notification_area'
).
remove
();
my_notify
(
'请选择答案'
);
}
console
.
log
(
answerArr
);
}
}
function
chooseAnswer
(
e
)
{
let
node
=
$
(
e
.
target
);
$
(
'.answer-active'
).
hide
();
nowAnswer
=
node
.
parent
(
'.question-block'
).
find
(
'.answer'
).
index
();
node
.
find
(
'div[class$=-active]'
).
show
();
}
function
showQuestion
()
{
function
showQuestion
()
{
initQuestion
();
initQuestion
();
$
(
'.home-page'
).
hide
();
$
(
'.home-page'
).
hide
();
...
@@ -85,6 +105,9 @@ function initQuestion() {
...
@@ -85,6 +105,9 @@ function initQuestion() {
$
(
'.question1-block'
).
show
();
$
(
'.question1-block'
).
show
();
$
(
'.btn-submit'
).
hide
();
$
(
'.btn-submit'
).
hide
();
$
(
'.btn-nextquestion'
).
show
();
$
(
'.btn-nextquestion'
).
show
();
nowQuestionIndex
=
1
;
answerArr
=
[];
nowAnswer
=
''
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment