A popular Custom Action that a number of our clients make use of is the Anchor Point Custom Action that allows for anchor link/tag functionality inside of your Experiences.
Our support team is able to add this to your account if needed, however, you can also add this to your account at any time via the following steps:
- Login to your Creator account
- In the Settings wheel in the top right corner, open the Set Up Integrations area
- Jump to the Custom Javascript Actions tab, then select Create New Action
- In the window that appears, paste the following lines of code:
var scrollDiv = "#{Anchor Tag}";
function scrollToDiv() {
var x = document.querySelector("a[title=" + scrollDiv + "]");
x.id = scrollDiv;
if(x.id === scrollDiv) {
x.scrollIntoView({behavior: "smooth"});
}
}
scrollToDiv(); - You can then name the Custom Action whatever you'd like, but we would suggest naming it "Anchor Tag" for simplicity sake
- Click Save. Now the action should appear in your Actions dropdown list when you are editing an Experience
The following video details how to use the Anchor Tag Custom Action in an Experience:
https://player.vimeo.com/video/429680780
Additionally, this example page shows an experience with Anchor Tags. The images at the top of the page have anchor links that will scroll you to the correct sections.
Please reach out to support@zmags.com if you have any questions on this!
Comments
0 comments
Please sign in to leave a comment.