mirror of
https://github.com/dawidolko/Website-Templates.git
synced 2026-03-22 16:42:16 +00:00
Website templates
This commit is contained in:
45
johndoe-portfolio-resume-bootstrap-template/js/parallax.js
Normal file
45
johndoe-portfolio-resume-bootstrap-template/js/parallax.js
Normal file
@@ -0,0 +1,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 );
|
||||
Reference in New Issue
Block a user