Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
masonstrap
Commits
6176f1b1
Commit
6176f1b1
authored
Dec 27, 2012
by
Thomas Park
Browse files
clean up javascript code
parent
e9b46a94
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/application.js
View file @
6176f1b1
!
function
(
$
)
{
(
function
(
$
)
{
$
(
function
(){
$
(
function
(){
// fix sub nav on scroll
var
$win
=
$
(
window
)
,
$nav
=
$
(
'
.subnav
'
)
,
navHeight
=
$
(
'
.navbar
'
).
first
().
height
()
,
navTop
=
$
(
'
.subnav
'
).
length
&&
$
(
'
.subnav
'
).
offset
().
top
-
navHeight
,
isFixed
=
0
// fix sub nav on scroll
var
$win
=
$
(
window
)
,
$nav
=
$
(
'
.subnav
'
)
,
navHeight
=
$
(
'
.navbar
'
).
first
().
height
()
,
navTop
=
$
(
'
.subnav
'
).
length
&&
$
(
'
.subnav
'
).
offset
().
top
-
navHeight
,
isFixed
=
0
;
processScroll
()
processScroll
()
;
$win
.
on
(
'
scroll
'
,
processScroll
)
$win
.
on
(
'
scroll
'
,
processScroll
)
;
function
processScroll
()
{
var
i
,
scrollTop
=
$win
.
scrollTop
()
if
(
scrollTop
>=
navTop
&&
!
isFixed
)
{
isFixed
=
1
$nav
.
addClass
(
'
subnav-fixed
'
)
}
else
if
(
scrollTop
<=
navTop
&&
isFixed
)
{
isFixed
=
0
$nav
.
removeClass
(
'
subnav-fixed
'
)
}
}
function
processScroll
()
{
var
i
,
scrollTop
=
$win
.
scrollTop
()
;
if
(
scrollTop
>=
navTop
&&
!
isFixed
)
{
isFixed
=
1
;
$nav
.
addClass
(
'
subnav-fixed
'
)
;
}
else
if
(
scrollTop
<=
navTop
&&
isFixed
)
{
isFixed
=
0
;
$nav
.
removeClass
(
'
subnav-fixed
'
)
;
}
}
})
})
;
}(
window
.
jQuery
)
\ No newline at end of file
})(
window
.
jQuery
);
\ 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