Added a cool parallax effect

This commit is contained in:
aggelosQQ 2017-01-12 22:12:37 +02:00
parent eb668fdf94
commit c7ebfd4797
6 changed files with 22 additions and 19 deletions

View file

@ -1,16 +1,3 @@
$(window).on('load', function() { // makes sure the whole site is loaded
$('#loading').fadeOut(); // will first fade out the loading animation
$('#load_screen').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.
$('body').delay(350).css({'overflow':'visible'});
})
$(document).ready(function() {
$(".skip").click(function() {
$('#loading').fadeOut(); // will first fade out the loading animation
$('#load_screen').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.
$('body').delay(350).css({'overflow':'visible'});
});
});
$(document).ready(function() {
$(".button-collapse").sideNav({
closeOnClick: true
@ -138,4 +125,16 @@ $(document).ready(function(){
scrollTop: $("html, body").offset().top
}, 1000);
});
});
});
var ypos,cover1,cover2,cover3;
function parallax() {
ypos = window.pageYOffset;
cover1 = document.getElementById('header');
cover1.style.top = ypos * .4 + 'px';
};
window.addEventListener('scroll', parallax);