forked from magento/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
41 lines (35 loc) · 1.04 KB
/
app.js
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
//= include _vendor/jsCookie.js
//= include _vendor/affix.js
//= include _vendor/scrollspy.js
//= include _vendor/clipboard.min.js
// This is what happens on document.ready
$(function() {
//= include _includes/analytics.js
//= include _includes/toc.js
//= include _includes/copy.js
//= include _includes/collapsible.js
//= include _includes/responsive.js
//= include _includes/dropdown.js
//= include _includes/anchors.js
//= include _includes/menu.js
//= include _includes/search.js
});
// END document ready
$(window).on('load', function(){
// Fix headers hiding behind nav when loading on anchor link
if(window.location.hash) {
$(document).scrollTop($(document).scrollTop() - 60);
}
});
// Fix anchor jumps hiding headers
/*
$(window).on('hashchange',function(){
$(document).scrollTop($(document).scrollTop() - 60);
});*/
//Allows for sticky menu
$(document).on('scroll', function(){
if( $(document).scrollTop() > 10 )
$('#global-nav').addClass('sticky-nav-main');
else
$('#global-nav').removeClass('sticky-nav-main');
});