Smooth scrolling allows you to easily jump between areas of your page without scrolling up and down, looking for specific sections manually. Smooth scrolling works very well when you have an anchor link that you want to jump to quickly from any part of your page. This is a great feature to add to your page to get your customer to that conversion button right away.
Here is a tutorial on how to set up your anchor links with smooth scrolling:
Creating Your Anchor Links
- Locate the element, section, or Unbounce form you would like to set up the anchor link.
- Click on this element, then navigate to the Element Metadata section at the bottom of the Properties tab on the builder's right side.
- Select & copy the ID value of this element. We’ll use this to create our Anchor Link.
If you’re using an Unbounce Button for your anchor link:
- Click on the button to which you’d like to add a smooth scrolling link.
- On the builder's right side, navigate to the Properties tab and scroll down to the Click Action tab.
- Using the URL field, type the # symbol, and paste in the ID value
If you’re using a piece of text as your anchor link:
- Double-click the text block and select the text that you’d like to turn into a link.
- On the builder's right side, navigate to the Properties tab, then select the Action tab.
- Using the URL field, type the # symbol, and paste in the ID value.
Click Save and Publish/Republish Your Page.
Smooth scrolling anchor links should be set up on your page making navigation on your page easier for your customers!
To use this custom smooth scrolling feature, you must first install jQuery, which is required for this script to work (set the placement to the Head).
- Locate and open the Unbounce builder for the page you’d like to add smooth scrolling to.
- In the Manage Scripts dialog box:
- Add Smooth Scrolling to the Link Name field.
- Select Before Body End Tag from the Placement menu.
- Paste the script below into the blank field.
- Click the Save Code button in the bottom right corner of the dialog box.
- As mentioned in the above note, remember to include the jQuery script in a new script box and the placement set to the Head. The smooth scrolling script will only work alongside jQuery.
- Be sure to Save and Publish/Republish your page.
To test out smooth scrolling on your page, open up the Preview mode, or view your published page. Custom scripts & CSS will only run in Preview mode or on a published page (and not in the builder).
Anchor link: A link on a page that brings you to a specific place on the same page.