|
717 | 717 | })
|
718 | 718 | </script>
|
719 | 719 |
|
720 |
| - <!--adjust sidebar and toc when footer is displayed --> |
721 |
| - <script type="text/javascript"> |
722 |
| - sidebar = document.querySelector('.sidebar') |
723 |
| - toc = document.querySelector('#toc') |
724 |
| - main = document.querySelector('.main') |
725 |
| - okd_footer = document.querySelector('.footer-origin-docs') |
726 |
| - |
727 |
| - //handle short pages |
728 |
| - if (window.innerHeight === document.documentElement.scrollHeight) { |
729 |
| - //sidebar |
730 |
| - if (sidebar !== null && okd_footer == null) { |
731 |
| - sidebar.style.marginBottom = "38px"; |
732 |
| - main.style.marginBottom = "35px"; |
733 |
| - }; |
734 |
| - //okd sidebar |
735 |
| - if(sidebar !== null && okd_footer !== null) { |
736 |
| - sidebar.style.marginBottom = "176px"; |
737 |
| - main.style.marginBottom = "135px"; |
738 |
| - } |
739 |
| - }; |
740 |
| - |
741 |
| - //handle scrolling pages |
742 |
| - document.addEventListener('scroll', () => { |
743 |
| - //scroll to bottom |
744 |
| - if ($(window).width() >= 1008) { |
745 |
| - if(sidebar !== null) { |
746 |
| - //pages with multiple toc entries |
747 |
| - if(document.documentElement.scrollHeight === window.pageYOffset + window.innerHeight) { |
748 |
| - //sidebar |
749 |
| - if (sidebar !== null && okd_footer == null){ |
750 |
| - sidebar.style.marginBottom = "38px"; |
751 |
| - main.style.marginBottom = "35px"; |
752 |
| - }; |
753 |
| - //toc |
754 |
| - if (toc !== null && okd_footer == null){ |
755 |
| - toc.style.bottom = "35px"; |
756 |
| - }; |
757 |
| - //okd sidebar |
758 |
| - if(sidebar !== null && okd_footer !== null) { |
759 |
| - sidebar.style.marginBottom = "176px"; |
760 |
| - main.style.marginBottom = "135px"; |
761 |
| - }; |
762 |
| - //okd toc |
763 |
| - if (toc !== null && okd_footer !== null){ |
764 |
| - toc.style.bottom = "175px"; |
765 |
| - }; |
766 |
| - }; |
767 |
| - if(document.documentElement.scrollHeight != window.pageYOffset + window.innerHeight) { |
768 |
| - sidebar.style.marginBottom = "0px"; |
769 |
| - if (toc !== null) { |
770 |
| - toc.style.bottom = "0px"; |
771 |
| - } |
772 |
| - } |
773 |
| - } |
774 |
| - } |
775 |
| - }) |
776 |
| - </script> |
777 |
| - |
778 | 720 | <!-- adjust alerts on mobile -->
|
779 | 721 | <script type="text/javascript">
|
780 | 722 | alert = document.querySelector('#support-alert')
|
|
803 | 745 | })
|
804 | 746 | </script>
|
805 | 747 |
|
| 748 | + <!-- hide footer after 3 seconds --> |
| 749 | + <script type="text/javascript"> |
| 750 | + const hideFooter = () => { |
| 751 | + document.querySelector('footer#rh').style.display = "none"; |
| 752 | + }; |
| 753 | + |
| 754 | + window.addEventListener('scroll', function() { |
| 755 | + if (window.innerHeight + window.scrollY >= document.body.offsetHeight) { |
| 756 | + setTimeout(hideFooter, 3000); |
| 757 | + } else { |
| 758 | + document.querySelector('footer#rh').style.display = "block"; |
| 759 | + } |
| 760 | + }) |
| 761 | + </script> |
806 | 762 | </body>
|
807 | 763 | </html>
|
0 commit comments