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