Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
chinaamc-2020flag
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
b09fbb23
authored
Jan 08, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
1afb6be8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
+20
-1
Public/static/js/common.js
+20
-1
No files found.
Public/static/js/common.js
View file @
b09fbb23
...
...
@@ -84,6 +84,8 @@ let flagStack = [];
let
chooseNum
=
0
;
let
oldRandFlag
=
[];
let
first
=
true
;
let
startX
;
let
timer
;
let
flagTemplate
=
$
(
'.flag-page .flag-frame'
).
find
(
'.flag-block'
).
clone
();
$
(
'.flag-frame'
).
html
(
''
).
addClass
(
'clearfix'
);
...
...
@@ -113,11 +115,28 @@ $(document).ready(function () {
$
(
'.personal-page .btn-tab-bgcolor'
).
on
(
'click'
,
showBgcolor
);
//选择色条触摸开始
$
(
'.personal-page .btn-choose-color'
).
on
(
'touchstart'
,
chooseColorStart
);
//选择色条拖动
$
(
'.personal-page .btn-choose-color'
).
on
(
'touchmove'
,
chooseColorMove
);
});
function
chooseColorStart
(
e
)
{
console
.
log
(
e
);
let
touch
=
e
.
originalEvent
.
targetTouches
[
0
];
startX
=
touch
.
pageX
;
}
function
chooseColorMove
(
e
)
{
if
(
timer
)
{
clearTimeout
(
timer
);
}
timer
=
setTimeout
(()
=>
{
let
touch
=
e
.
originalEvent
.
targetTouches
[
0
];
moveX
=
touch
.
pageX
;
let
left
=
parseInt
(
$
(
'.personal-page .btn-choose-color'
).
css
(
'left'
));
left
=
left
+
(
moveX
-
startX
);
console
.
log
(
left
);
$
(
'.personal-page .btn-choose-color'
).
css
(
'left'
,
left
);
startX
=
moveX
;
},
5
);
}
function
showBgcolor
()
{
...
...
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