Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
news
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sartika Aritonang
news
Commits
af055df7
Commit
af055df7
authored
May 28, 2020
by
Sartika Aritonang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
75da9187
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
grayscale.js
project/static/home_design/js/grayscale.js
+42
-0
No files found.
project/static/home_design/js/grayscale.js
0 → 100644
View file @
af055df7
(
function
(
$
)
{
"use strict"
;
// Start of use strict
// Smooth scrolling using jQuery easing
$
(
'a.js-scroll-trigger[href*="#"]:not([href="#"])'
).
click
(
function
()
{
if
(
location
.
pathname
.
replace
(
/^
\/
/
,
''
)
==
this
.
pathname
.
replace
(
/^
\/
/
,
''
)
&&
location
.
hostname
==
this
.
hostname
)
{
var
target
=
$
(
this
.
hash
);
target
=
target
.
length
?
target
:
$
(
'[name='
+
this
.
hash
.
slice
(
1
)
+
']'
);
if
(
target
.
length
)
{
$
(
'html, body'
).
animate
({
scrollTop
:
(
target
.
offset
().
top
-
70
)
},
1000
,
"easeInOutExpo"
);
return
false
;
}
}
});
// Closes responsive menu when a scroll trigger link is clicked
$
(
'.js-scroll-trigger'
).
click
(
function
()
{
$
(
'.navbar-collapse'
).
collapse
(
'hide'
);
});
// Activate scrollspy to add active class to navbar items on scroll
$
(
'body'
).
scrollspy
({
target
:
'#mainNav'
,
offset
:
100
});
// Collapse Navbar
var
navbarCollapse
=
function
()
{
if
(
$
(
"#mainNav"
).
offset
().
top
>
100
)
{
$
(
"#mainNav"
).
addClass
(
"navbar-shrink"
);
}
else
{
$
(
"#mainNav"
).
removeClass
(
"navbar-shrink"
);
}
};
// Collapse now if page is not at top
navbarCollapse
();
// Collapse the navbar when page is scrolled
$
(
window
).
scroll
(
navbarCollapse
);
})(
jQuery
);
// End of use strict
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