-
Notifications
You must be signed in to change notification settings - Fork 0
/
parallax.js
45 lines (34 loc) · 1.11 KB
/
parallax.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
42
43
44
45
/* ==============================================
Parallax
=============================================== */
( function( $ ) {
// Setup variables
$window = $(window);
$slide = $('.homeSlide');
$body = $('body');
//FadeIn all sections
$body.imagesLoaded( function() {
setTimeout(function() {
// Resize sections
adjustWindow();
// Fade in sections
$body.removeClass('loading').addClass('loaded');
}, 800);
});
function adjustWindow(){
// Init Skrollr
var s = skrollr.init({
forceHeight: false
});
// Get window size
winH = $window.height();
// Keep minimum height 550
if(winH <= 450) {
winH = 450;
}
// Resize our slides
$slide.height(winH);
// Refresh Skrollr after resizing our sections
s.refresh($('.homeSlide'));
}} )
( jQuery );