How can we help you today?

How to Keep the ShortPoint Footer at the Bottom of the Page

SharePoint pages with minimal content, like the one below, will display the ShortPoint footer in the middle of the page rather than at the bottom:


sample SharePoint page with footer


This article demonstrates how to keep the ShortPoint footer at the bottom of your page using JavaScript.


fixed ShortPoint footer


TABLE OF CONTENTS


Prerequisites


Interactive Tutorial

Before starting the interactive tutorial, copy the JavaScript below:

  function setMinHeightToScrollContent() {
    if (window.location.href.includes('_layouts/')) {
      return;
    }
    
    const contentElement = document.querySelector('.shortpoint-proxy-theme-scroll-content');
    const footerElement = document.querySelector('.shortpoint_footer_wrap');
    
    if (contentElement && footerElement) {
      const contentHeight = contentElement.scrollHeight;
      const windowHeight = window.innerHeight;
      
      if (contentHeight >= windowHeight) {
        return;
      }

      const contentRect = contentElement.getBoundingClientRect();
      const contentPositionFromTop = contentRect.top + window.scrollY;
      const footerHeight = footerElement.offsetHeight;
      const totalOffset = footerHeight + contentPositionFromTop;
      contentElement.style.minHeight = `calc(100vh - ${totalOffset}px)`;
    }
  }

  setTimeout(() => {
    setMinHeightToScrollContent();
  }, 3000);
  
  window.addEventListener('resize', setMinHeightToScrollContent);

Step-by-step Tutorial

Follow the steps below to keep your ShortPoint footer at the bottom of the page:


NOTEBefore proceeding, make sure you already have a ShortPoint footer on your page. To add a footer, check out Getting Started with ShortPoint Footer for SharePoint. 

sample footer


Step 1: Copy JavaScript Code

  • Copy the JavaScript code below:
  function setMinHeightToScrollContent() {
    if (window.location.href.includes('_layouts/')) {
      return;
    }
    
    const contentElement = document.querySelector('.shortpoint-proxy-theme-scroll-content');
    const footerElement = document.querySelector('.shortpoint_footer_wrap');
    
    if (contentElement && footerElement) {
      const contentHeight = contentElement.scrollHeight;
      const windowHeight = window.innerHeight;
      
      if (contentHeight >= windowHeight) {
        return;
      }

      const contentRect = contentElement.getBoundingClientRect();
      const contentPositionFromTop = contentRect.top + window.scrollY;
      const footerHeight = footerElement.offsetHeight;
      const totalOffset = footerHeight + contentPositionFromTop;
      contentElement.style.minHeight = `calc(100vh - ${totalOffset}px)`;
    }
  }

  setTimeout(() => {
    setMinHeightToScrollContent();
  }, 3000);
  
  window.addEventListener('resize', setMinHeightToScrollContent);

Step 2: Open Theme Builder

  • Go to the SharePoint page you want to use and click the ShortPoint icon:


ShortPoint icon


  • Select Theme Builder.

Step 3: Open Custom JavaScript

  • Go to Utilities.
  • Select Custom JavaScript.

Step 4: Paste and Apply Code

  • Paste the code in the field provided.
  • Click Apply:


Apply


Step 5: Publish

  • Once satisfied, Publish your changes.


Congratulations! Your ShortPoint footer is now fixed at the bottom of the page:


fixed ShortPoint footer


Related articles:

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 20 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more