Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
sora
/
achievement
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
39e7e271
authored
Mar 27, 2020
by
o.kimura
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
テーブルヘッダ固定調整中
parent
b1ad492d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
0 deletions
achievement-official.conohawing.com/assets/js/jquery.fixedTableHeader.js
achievement-official.conohawing.com/assets/js/jquery.fixedTableHeader.min.js
achievement-official.conohawing.com/common_previous/js/jquery.min.js
achievement-official.conohawing.com/assets/js/jquery.fixedTableHeader.js
0 → 100644
View file @
39e7e271
/*!
* jQuery FixedTableHeader plugin
*
* Copyright 2014 Hung Nguyen
*
* Date: Tue Nov 4 2014 07:00:00 GMT
*/
/*jslint browser: true, nomen: true, unparam: true, node: true*/
/*global $, jQuery*/
'use strict'
;
(
function
(
$
)
{
$
.
fn
.
fixedTableHeader
=
function
()
{
return
this
.
each
(
function
(
key
,
item
)
{
var
$self
=
$
(
this
),
$fixedHeader
,
$originalHeader
,
tableTopOffset
,
tableBottomOffset
,
headerHeight
,
originalWidth
=
[];
$self
.
find
(
'thead > tr > th'
).
each
(
function
(
key
,
item
)
{
originalWidth
.
push
(
$
(
item
).
outerWidth
());
});
function
init
()
{
var
ua
=
navigator
.
userAgent
;
if
(
ua
.
indexOf
(
'iPhone'
)
>
0
||
ua
.
indexOf
(
'Android'
)
>
0
&&
ua
.
indexOf
(
'Mobile'
)
>
0
)
{
$originalHeader
=
$self
.
find
(
'thead:first'
);
$fixedHeader
=
$originalHeader
.
clone
();
$fixedHeader
.
css
(
'position'
,
'fixed'
);
$fixedHeader
.
css
(
'display'
,
'none'
);
$fixedHeader
.
css
(
'height'
,
$self
.
find
(
'thead'
).
outerHeight
());
$fixedHeader
.
css
(
'width'
,
$self
.
find
(
'thead'
).
outerWidth
());
$fixedHeader
.
css
(
'top'
,
100
);
$fixedHeader
.
css
(
'left'
,
$self
.
find
(
'thead'
).
offset
().
left
);
$fixedHeader
.
css
(
'margin-top'
,
0
);
$fixedHeader
.
css
(
'z-index'
,
1
);
$originalHeader
.
after
(
$fixedHeader
);
}
else
{
$originalHeader
=
$self
.
find
(
'thead:first'
);
$fixedHeader
=
$originalHeader
.
clone
();
$fixedHeader
.
css
(
'position'
,
'fixed'
);
$fixedHeader
.
css
(
'display'
,
'none'
);
$fixedHeader
.
css
(
'height'
,
$self
.
find
(
'thead'
).
outerHeight
());
$fixedHeader
.
css
(
'width'
,
$self
.
find
(
'thead'
).
outerWidth
());
$fixedHeader
.
css
(
'top'
,
50
);
$fixedHeader
.
css
(
'left'
,
$self
.
find
(
'thead'
).
offset
().
left
);
$fixedHeader
.
css
(
'margin-top'
,
0
);
$fixedHeader
.
css
(
'z-index'
,
1
);
$originalHeader
.
after
(
$fixedHeader
);
}
}
function
left
()
{
return
parseInt
(
$self
.
offset
().
left
,
10
)
-
parseInt
(
$
(
window
).
scrollLeft
(),
10
);
}
function
onResize
()
{
$fixedHeader
.
css
(
'left'
,
left
());
$fixedHeader
.
css
(
'width'
,
$self
.
find
(
'thead'
).
outerWidth
());
$fixedHeader
.
find
(
"th"
).
each
(
function
(
index
)
{
originalWidth
[
index
]
=
$originalHeader
.
find
(
"th"
).
eq
(
index
).
outerWidth
();
$
(
this
).
css
(
"min-width"
,
$originalHeader
.
find
(
"th"
).
eq
(
index
).
outerWidth
());
$
(
this
).
css
(
"max-width"
,
$originalHeader
.
find
(
"th"
).
eq
(
index
).
outerWidth
());
});
}
function
onScroll
()
{
tableTopOffset
=
$self
.
offset
().
top
;
headerHeight
=
$fixedHeader
.
find
(
'tr'
).
height
();
tableBottomOffset
=
tableTopOffset
+
$self
.
height
()
-
headerHeight
;
$fixedHeader
.
find
(
'th'
).
each
(
function
(
key
,
item
)
{
$
(
item
).
css
(
'min-width'
,
parseInt
(
originalWidth
[
key
],
10
));
$
(
item
).
css
(
'max-width'
,
parseInt
(
originalWidth
[
key
],
10
));
});
$fixedHeader
.
css
(
'left'
,
left
());
if
(
$
(
window
).
scrollTop
()
>
tableTopOffset
&&
$
(
window
).
scrollTop
()
<
tableBottomOffset
)
{
$fixedHeader
.
show
();
}
else
{
$fixedHeader
.
hide
();
}
}
init
();
$
(
window
).
resize
(
onResize
);
$
(
window
).
scroll
(
onScroll
);
});
};
}(
jQuery
));
achievement-official.conohawing.com/assets/js/jquery.fixedTableHeader.min.js
0 → 100644
View file @
39e7e271
"use strict"
;
!
function
(
e
){
e
.
fn
.
fixedTableHeader
=
function
(){
return
this
.
each
(
function
(){
function
c
(){
var
e
=
navigator
.
userAgent
;
e
.
indexOf
(
"iPhone"
)
>
0
||
e
.
indexOf
(
"Android"
)
>
0
&&
e
.
indexOf
(
"Mobile"
)
>
0
?(
o
=
i
.
find
(
"thead:first"
),
r
=
o
.
clone
(),
r
.
css
(
"position"
,
"fixed"
),
r
.
css
(
"display"
,
"none"
),
r
.
css
(
"height"
,
i
.
find
(
"thead"
).
outerHeight
()),
r
.
css
(
"width"
,
i
.
find
(
"thead"
).
outerWidth
()),
r
.
css
(
"top"
,
100
),
r
.
css
(
"left"
,
i
.
find
(
"thead"
).
offset
().
left
),
r
.
css
(
"margin-top"
,
0
),
r
.
css
(
"z-index"
,
1
),
o
.
after
(
r
)):(
o
=
i
.
find
(
"thead:first"
),
r
=
o
.
clone
(),
r
.
css
(
"position"
,
"fixed"
),
r
.
css
(
"display"
,
"none"
),
r
.
css
(
"height"
,
i
.
find
(
"thead"
).
outerHeight
()),
r
.
css
(
"width"
,
i
.
find
(
"thead"
).
outerWidth
()),
r
.
css
(
"top"
,
50
),
r
.
css
(
"left"
,
i
.
find
(
"thead"
).
offset
().
left
),
r
.
css
(
"margin-top"
,
0
),
r
.
css
(
"z-index"
,
1
),
o
.
after
(
r
))}
function
f
(){
return
parseInt
(
i
.
offset
().
left
,
10
)
-
parseInt
(
e
(
window
).
scrollLeft
(),
10
)}
function
d
(){
r
.
css
(
"left"
,
f
()),
r
.
css
(
"width"
,
i
.
find
(
"thead"
).
outerWidth
()),
r
.
find
(
"th"
).
each
(
function
(
t
){
l
[
t
]
=
o
.
find
(
"th"
).
eq
(
t
).
outerWidth
(),
e
(
this
).
css
(
"min-width"
,
o
.
find
(
"th"
).
eq
(
t
).
outerWidth
()),
e
(
this
).
css
(
"max-width"
,
o
.
find
(
"th"
).
eq
(
t
).
outerWidth
())})}
function
p
(){
s
=
i
.
offset
().
top
,
u
=
r
.
find
(
"tr"
).
height
(),
a
=
s
+
i
.
height
()
-
u
,
r
.
find
(
"th"
).
each
(
function
(
t
,
n
){
e
(
n
).
css
(
"min-width"
,
parseInt
(
l
[
t
],
10
)),
e
(
n
).
css
(
"max-width"
,
parseInt
(
l
[
t
],
10
))}),
r
.
css
(
"left"
,
f
()),
e
(
window
).
scrollTop
()
>
s
&&
e
(
window
).
scrollTop
()
<
a
?
r
.
show
():
r
.
hide
()}
var
r
,
o
,
s
,
a
,
u
,
i
=
e
(
this
),
l
=
[];
i
.
find
(
"thead > tr > th"
).
each
(
function
(
t
,
n
){
l
.
push
(
e
(
n
).
outerWidth
())}),
c
(),
e
(
window
).
resize
(
d
),
e
(
window
).
scroll
(
p
)})}}(
jQuery
);
\ No newline at end of file
achievement-official.conohawing.com/common_previous/js/jquery.min.js
0 → 100644
View file @
39e7e271
This diff is collapsed.
Click to expand it.
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