Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const body = document.getElementsByTagName('body')[0];
- body.style.backgroundColor = 'black';
- let yellowlogo = document.getElementsByClassName('logo')[0];
- yellowlogo.style.bottom = '30px';
- window.onscroll = function (event) {
- const scroll = window.pageYOffset;
- if (scroll < 750) {
- body.style.backgroundColor = 'black';
- } else {
- body.style.backgroundColor = 'white';
- }
- if (scroll < 200) {
- yellowlogo.style.bottom = '30px';
- } else {
- yellowlogo.style.bottom = '-50px';
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement