Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
pingan-charity
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
52a3f4b3
authored
Feb 24, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
9cf9bcde
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
18 deletions
+39
-18
Public/static/js/common.js
+39
-18
No files found.
Public/static/js/common.js
View file @
52a3f4b3
...
@@ -101,7 +101,28 @@ const video3 = document.getElementById("video3");
...
@@ -101,7 +101,28 @@ const video3 = document.getElementById("video3");
$
(
'.page1'
).
show
();
$
(
'.page1'
).
show
();
preloadimages
(
preloadImageList
,
function
()
{},
function
(
progress
)
{});
preloadimages
(
preloadImageList
,
function
()
{},
function
(
progress
)
{});
$
(
document
).
ready
(
function
()
{
var
EventUtil
=
{
addHandler
:
function
(
element
,
type
,
handler
)
{
if
(
element
.
addEventListener
)
{
element
.
addEventListener
(
type
,
handler
,
false
);
}
else
if
(
element
.
attachEvent
)
{
element
.
attachEvent
(
"on"
+
type
,
handler
);
}
else
{
element
[
"on"
+
type
]
=
handler
;
}
}
};
(
function
()
{
var
showCount
=
0
;
EventUtil
.
addHandler
(
window
,
"load"
,
function
()
{});
EventUtil
.
addHandler
(
window
,
"pageshow"
,
function
(
event
)
{
showCount
++
;
alert
(
"Show has been fired "
+
showCount
+
" times."
);
});
$
(
document
).
ready
(
function
()
{
for
(
let
i
=
0
;
i
<
21
;
i
++
)
{
for
(
let
i
=
0
;
i
<
21
;
i
++
)
{
$
(
'.read'
+
i
).
hide
();
$
(
'.read'
+
i
).
hide
();
}
}
...
@@ -245,9 +266,9 @@ $(document).ready(function () {
...
@@ -245,9 +266,9 @@ $(document).ready(function () {
link
:
linkAddress
.
link20
,
link
:
linkAddress
.
link20
,
index
:
20
index
:
20
},
jumpTolink
);
},
jumpTolink
);
});
});
function
jumpTolink
(
event
)
{
function
jumpTolink
(
event
)
{
const
link
=
event
.
data
.
link
;
const
link
=
event
.
data
.
link
;
if
(
event
.
data
.
index
||
event
.
data
.
index
==
0
)
{
if
(
event
.
data
.
index
||
event
.
data
.
index
==
0
)
{
const
index
=
event
.
data
.
index
;
const
index
=
event
.
data
.
index
;
...
@@ -259,10 +280,10 @@ function jumpTolink(event) {
...
@@ -259,10 +280,10 @@ function jumpTolink(event) {
window
.
location
.
href
=
link
;
window
.
location
.
href
=
link
;
},
100
);
},
100
);
}
}
function
getTranslateDistance
(
cardinal
=
0
,
abs
=
false
)
{
function
getTranslateDistance
(
cardinal
=
0
,
abs
=
false
)
{
var
wrapInnerTransform
=
$
(
'.wrap-inner'
).
css
(
'transform'
);
var
wrapInnerTransform
=
$
(
'.wrap-inner'
).
css
(
'transform'
);
var
wrapInnertop
=
parseFloat
(
$
(
'.wrap-inner'
).
css
(
'top'
));
var
wrapInnertop
=
parseFloat
(
$
(
'.wrap-inner'
).
css
(
'top'
));
wrapInnerTransform
=
wrapInnerTransform
.
match
(
/^matrix
\(
1,
\s
0,
\s
0,
\s
1,
\s
0,
\s\-?(\d
+
)
/
);
wrapInnerTransform
=
wrapInnerTransform
.
match
(
/^matrix
\(
1,
\s
0,
\s
0,
\s
1,
\s
0,
\s\-?(\d
+
)
/
);
...
@@ -274,29 +295,29 @@ function getTranslateDistance(cardinal = 0, abs = false) {
...
@@ -274,29 +295,29 @@ function getTranslateDistance(cardinal = 0, abs = false) {
}
}
return
wrapInnerjl
+
cardinal
+
'px'
;
return
wrapInnerjl
+
cardinal
+
'px'
;
}
}
//获取随机数方法
//获取随机数方法
//min 最小值
//min 最小值
//max 最大值
//max 最大值
function
RandomNumBoth
(
Min
,
Max
)
{
function
RandomNumBoth
(
Min
,
Max
)
{
var
Range
=
Max
-
Min
;
var
Range
=
Max
-
Min
;
var
Rand
=
Math
.
random
();
var
Rand
=
Math
.
random
();
var
num
=
Min
+
Math
.
round
(
Rand
*
Range
);
//四舍五入
var
num
=
Min
+
Math
.
round
(
Rand
*
Range
);
//四舍五入
return
num
;
return
num
;
}
}
//写cookies
//写cookies
function
setCookie
(
name
,
value
)
{
function
setCookie
(
name
,
value
)
{
var
Days
=
30
;
var
Days
=
30
;
var
exp
=
new
Date
();
var
exp
=
new
Date
();
exp
.
setTime
(
exp
.
getTime
()
+
Days
*
24
*
60
*
60
*
1000
);
exp
.
setTime
(
exp
.
getTime
()
+
Days
*
24
*
60
*
60
*
1000
);
document
.
cookie
=
name
+
"="
+
escape
(
value
)
+
";expires="
+
exp
.
toGMTString
();
document
.
cookie
=
name
+
"="
+
escape
(
value
)
+
";expires="
+
exp
.
toGMTString
();
}
}
//读取cookies
//读取cookies
function
getCookie
(
name
)
{
function
getCookie
(
name
)
{
var
arr
,
reg
=
new
RegExp
(
"(^| )"
+
name
+
"=([^;]*)(;|$)"
);
var
arr
,
reg
=
new
RegExp
(
"(^| )"
+
name
+
"=([^;]*)(;|$)"
);
if
(
arr
=
document
.
cookie
.
match
(
reg
))
if
(
arr
=
document
.
cookie
.
match
(
reg
))
...
@@ -304,4 +325,4 @@ function getCookie(name) {
...
@@ -304,4 +325,4 @@ function getCookie(name) {
return
unescape
(
arr
[
2
]);
return
unescape
(
arr
[
2
]);
else
else
return
null
;
return
null
;
}
}
\ No newline at end of file
\ No newline at end of file
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