FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
userscript/scripts/searchEngineJumpCE/src/DropDownList.js at master · dumpmemory/userscript · GitHub
dumpmemory
userscript
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
userscript
/
scripts
/
searchEngineJumpCE
/
src
/
DropDownList.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
107 lines (85 loc) · 2.76 KB
Breadcrumbs
userscript
/
scripts
/
searchEngineJumpCE
/
src
/
DropDownList.js
Copy path
File metadata and controls
107 lines (85 loc) · 2.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// 列表对象
function
DropDownList
(
a
,
list
)
{
this
.
a
=
a
;
this
.
list
=
list
;
this
.
init
(
)
;
}
;
DropDownList
.
zIndex
=
100000000
;
DropDownList
.
prototype
=
{
hidden
:
true
,
showDelay
:
233
,
hideDelay
:
266
,
aShownClass
:
'sej-drop-list-trigger-shown'
,
init
:
function
(
)
{
var
a
=
this
.
a
;
var
list
=
this
.
list
;
var
self
=
this
;
// 进入显示
mouseEventListener
.
add
(
'mouseenter'
,
a
,
function
(
)
{
clearTimeout
(
self
.
hideTimerId
)
;
if
(
self
.
hidden
)
{
self
.
showTimerId
=
setTimeout
(
function
(
)
{
self
.
show
(
)
;
}
,
self
.
showDelay
)
;
}
else
{
var
style
=
list
.
style
;
style
.
zIndex
=
DropDownList
.
zIndex
++
;
style
.
opacity
=
0.96
;
}
;
}
)
;
// 离开隐藏
mouseEventListener
.
add
(
'mouseleave'
,
a
,
function
(
)
{
clearTimeout
(
self
.
showTimerId
)
;
if
(
!
self
.
hidden
)
{
list
.
style
.
opacity
=
0.3
;
self
.
hideTimerId
=
setTimeout
(
function
(
)
{
self
.
hide
(
)
;
}
,
self
.
hideDelay
)
;
}
;
}
)
;
mouseEventListener
.
add
(
'mouseenter'
,
list
,
function
(
)
{
clearTimeout
(
self
.
hideTimerId
)
;
var
style
=
list
.
style
;
style
.
zIndex
=
DropDownList
.
zIndex
++
;
style
.
opacity
=
0.96
;
}
)
;
mouseEventListener
.
add
(
'mouseleave'
,
list
,
function
(
)
{
list
.
style
.
opacity
=
0.3
;
self
.
hideTimerId
=
setTimeout
(
function
(
)
{
self
.
hide
(
)
;
}
,
self
.
hideDelay
)
;
}
)
;
}
,
show
:
function
(
)
{
if
(
!
this
.
hidden
)
return
;
this
.
hidden
=
false
;
var
scrolled
=
getScrolled
(
)
;
var
aBCRect
=
this
.
a
.
getBoundingClientRect
(
)
;
var
style
=
this
.
list
.
style
;
var
top
,
left
;
if
(
this
.
a
.
dataset
.
horizontal
)
{
// 向右展开
top
=
scrolled
.
y
+
aBCRect
.
top
;
left
=
scrolled
.
x
+
aBCRect
.
left
+
this
.
a
.
clientWidth
;
}
else
{
// 默认的向下展开
top
=
scrolled
.
y
+
aBCRect
.
bottom
;
left
=
scrolled
.
x
+
aBCRect
.
left
;
}
style
.
top
=
top
+
6
+
'px'
;
style
.
left
=
left
+
'px'
;
style
.
zIndex
=
DropDownList
.
zIndex
++
;
style
.
display
=
'block'
;
setTimeout
(
function
(
)
{
style
.
opacity
=
0.96
;
style
.
top
=
top
+
'px'
;
}
,
30
)
;
this
.
a
.
classList
.
add
(
this
.
aShownClass
)
;
}
,
hide
:
function
(
)
{
if
(
this
.
hidden
)
return
;
this
.
hidden
=
true
;
var
style
=
this
.
list
.
style
;
style
.
display
=
'none'
;
style
.
opacity
=
0.3
;
this
.
a
.
classList
.
remove
(
this
.
aShownClass
)
;
}
,
}
;
Back
|
FazBrowse Home
|
New Git URL