A PopUp is a great way to show a call to action. In this tutorial we will show you how to link the PopUp to open when a button or image is clicked.
* If you need to know how to create a PopUp you can read this article
This tutorial has two main steps:
- Enable Site-wide PopUp Linking Settings
- Enable Link Settings on a PopUp
- Add class to an image to make it clickable
- IMPORTANT for Making Clickable PopUps Work for iOS Devices
Enable Site-wide PopUp Linking Settings
This step will allow your PopUps to be opened by clicking a link. Once you complete this for your site it will enable the settings for all PopUps, it only needs to be done once.
- Go to PopUp > Settings.
- On the Settings Page:
- Click the "Load PopUp using" dropdown and set to Page Footer
- Scroll down a little bit and check "JavaScript Events"
- Click "Save" at the bottom of the page
Enable Link Settings on a PopUp
- Create a PopUp or edit an existing one.
* If you need to know how to create a PopUp you can read this article
- When editing a PopUp, scroll to the "Behavior" section on the right-hand side.
- Click the "Appear when user clicks on a CSS selector" option
- In the text field, type a new class name to use as a trigger. Use unique name and don’t add spaces or special characters. It should be formatted with a period, then a unique name. Example: .PopUp1
- Check the "Repeated" box next to it so users can click it multiple times
- Make sure your PopUP is "Active" and click "Save"
Add Class to an Image to Make it Clickable
- Edit a page or blog post
- Find an image you want to link to a pop up
- Click on the image
- Click on the "Edit" pencil that appears
- In the Edit area, click "Advanced Options"
- In the "Image CSS Class" field, add the class you created in the PopUp you want to link to.
IMPORTANT: DO NOT add the period here. Make sure the capitalization and spelling matches exactly to what you added in your PopUp settings.
- Save the Page or Post you are editing
- Go to the page to preview/test that the PopUp is working when the image is clicked.
IMPORTANT for Making Clickable PopUps Work for iOS Devices
There is an issue with iOS not registering click/touch events bound to elements. In other words, there is another step needed to make the PopUps work properly for Mobile iOS devices
- Edit the PopUp you want to open on click
- Copy the class you added from Step 3
- Scroll to the bottom of the edit page and find the "Custom CSS" section
- In that section, paste the class you used and add
{cursor: pointer;}
after it.
It should look something like this:.yourClassName {cursor: pointer;}
- Save the PopUp and it should start working on iOS