-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixedScrollPage.js
More file actions
55 lines (51 loc) · 2.05 KB
/
fixedScrollPage.js
File metadata and controls
55 lines (51 loc) · 2.05 KB
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
const introSection = $('.custom-scroll-on .intro-sections');
const contentSections = $('.custom-scroll-on .content-sections');
const secondContentSections = $('.custom-scroll-on .second-content-sections');
const footerSection = $('.custom-scroll-on .footer');
const sectionsConfiguration = {
'sectionHeight': 0,
'contentSectionsWidth': 0,
'contentVerticalHeight': 0,
'lastSectionHeight': 0,
'maxOffset': 0,
'sectionsReady': true,
'topOffset': 0,
'leftOffset': 0,
'positiveScrollSensitivity': 0,
'negativeScrollSensitivity': 0,
'lastSection': false,
'maxSensitivity': 200,
'minSensitivity': -200,
'verticalContentPosition': 0,
'footerSectionActive': false,
'touchStart': {
'deltaY': 0
},
'touchEnd': {
'deltaY': 0
},
}
function updateSectionConfiguration() {
sectionsConfiguration.sectionHeight = contentSections.height();
sectionsConfiguration.contentSectionsWidth = contentSections.width();
sectionsConfiguration.contentVerticalHeight = secondContentSections.height() + $('.intro-9').height();
sectionsConfiguration.lastSectionHeight = $('.intro-9').height();
sectionsConfiguration.maxOffset = contentSections.width() - contentSections.width() / 5;
sectionsConfiguration.sectionsReady = true;
sectionsConfiguration.topOffset = 0;
sectionsConfiguration.leftOffset = 0;
sectionsConfiguration.lastSection = false;
sectionsConfiguration.verticalContentPosition = 0,
sectionsConfiguration.footerSectionActive = false;
sectionsConfiguration.touchStart.deltaY = 0;
sectionsConfiguration.touchEnd.deltaY = 0;
introSection.children().addClass('section-block');
contentSections.children().addClass('section-block');
secondContentSections.children().addClass('section-block');
footerSection.children().addClass('section-block');
introSection.removeAttr('style');
contentSections.removeAttr('style');
secondContentSections.removeAttr('style');
footerSection.removeAttr('style');
};
updateSectionConfiguration();