mirror of
https://github.com/TotalFreedomMC/Website.git
synced 2025-07-23 14:03:46 +00:00
Added a cool parallax effect
This commit is contained in:
parent
eb668fdf94
commit
c7ebfd4797
6 changed files with 22 additions and 19 deletions
27
js/main.js
27
js/main.js
|
@ -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);
|
Loading…
Add table
Add a link
Reference in a new issue