|
|
Line 9: |
Line 9: |
| action=raw&ctype=text/javascript"></script> | | action=raw&ctype=text/javascript"></script> |
| <script> | | <script> |
− |
| |
− | window.onscroll = function() {scrollFunction()};
| |
− |
| |
− | function myFunction() {
| |
− | var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
| |
− | var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
| |
− | var scrolled = (winScroll / height) * 100;
| |
− | document.getElementById("myBar").style.height = scrolled + "%";
| |
− | }
| |
− |
| |
− | $(window).on('scroll', function() {
| |
− | if ($(window).scrollTop()) {
| |
− | $('.container').css('background', '#808080');
| |
− | $('nav ul li ul').css('background', '#808080');
| |
− | $('nav').css('opacity', '1');
| |
− | } else {
| |
− | $('.container').css('background', '#000000');
| |
− | $('nav ul li ul').css('background', '#000000');
| |
− | $('nav').css('opacity', '1');
| |
− | }
| |
− | });
| |
| | | |
| | | |