How to Use InDesign: Mouse Rollovers

Graphic. Hover effect illustrated on a thumbnail gallery within an interactive PDF.
Share on facebook
Share on twitter
Share on pinterest
Share on linkedin

Did you know? Adobe InDesign makes interactive PDFs too! Not limited to just Acrobat Pro, Acrobat DC, InDesign allows hover effects on rollover (or mouseover) just like websites do. Learn how how to use InDesign to make interactive rollover buttons and effects. This tutorial displays a caption when a user hovers over an image in an InDesign interactive PDF.

I focus on the popular user interaction of hover, also known as mouseover or rollover. For this tutorial on interactive InDesign mouse rollovers, I want a byline caption to appear when the user hovers over a photo.

Lara Lee Design | How to Use InDesign: Mouse Rollovers, Learn More >

Step-by-Step Tutorial for Using InDesign to Make Interactive Rollover Buttons & Effects

Position the images.

When placing images on the InDesign document, align the photo (passive) images directly behind their matching byline (active images). By the end of the button creation, these positions will reverse.

Note about inputting buttons and steps in a particular order.

InDesign is picky about the precise order the buttons and their actions are created.

When I input all the photo (passive) actions together, and then input all the byline (active) actions together, the final PDF failed to display the photo. Perhaps there’s coding from InDesign’s scripts behind the scenes that affect this.

For a guaranteed hover effect, I found I must:

  • create the byline (active) first…
  • add one of its two actions—the second is contingent on the photo (passive) button which doesn’t exist yet—then…
  • create the photo (passive) button and both of its actions, before…
  • finally returning to add the last action to the byline (active) button.

If the exported interactive PDF fails to perform as expected, redo the steps in this order.

Setup InDesign’s workspace for interactivity.

In InDesign’s Application bar across the top, open Window > Interactive > Buttons and Forms. Some tutorials recommend using SWF Preview also found in the Interactive panels to test the hover effects. However, since SWF and Interactive PDFs are different file formats with different code, it’s still best to export an interactive PDF for the most truthful previews. (In fact, in writing this tutorial I witnessed my interactive rollover buttons working in SWF Preview but not my interactive PDFs.)

Create the first button.

Select one of the passive images (the photo), and click the “Convert to Button” button at the bottom-right of the Buttons and Forms.

Label the button and add a rollover event.

Label the button something that’s readily identifiable, such as “Berries Byline,” in the Name This part is especially important if the document has multiple pairs of buttons. Since the byline image is activated by the mouse moving onto the photo image, the button needs a rollover event. In the Event field, select On Roll Over from the dropdown menu. Click the plus icon to add a new Action and select “Show/Hide Buttons and Forms.”

Assign an action to the byline (active) button to hide itself on rollover.

Leave the Visibility to its default setting, a gray X icon for “Ignore.”

Create the second button, label, and add a rollover event.

Click on the byline (active) button in the document to return focus there too. Send it to the back (Ctrl + Shift + [) to bring the photo (passive) button forward. Using the Buttons and Forms panel, convert the image to a button and label appropriately. Set the Event to On Roll Over and add an Action to “Show/Hide Buttons and Forms.” In the Visibility field, click the default gray X icon for “Ignore” twice so it instead shows a crossed-out eye icon for “Hide.”

Assign an action to the same button to ignore on roll-off.

Return to the Event field and now select On Roll Off. Click the plus icon and again select “Show/Hide Buttons and Forms.” Leave the default Visibility action set to “Ignore,” the gray X icon.

Add the last roll-off event: show the photo (passive) button.

There’s one more action to add: the roll-off event for the first button, the byline (active) image. Select the photo (passive) button we’ve been working on, and send it to the back with Ctrl + Shift + [. Now the photo (passive) button is on top again. In the Buttons and Forms panel, change the Event to On Roll Off and again select the “Show/Hide Buttons and Forms” action. Find the photo (passive) button in the Visibility list and click the “Ignore” X icon once to change the setting to “Show,” an open eye icon. Click the byline (active) button in the document, then enter Ctrl + Shift + [ to it all the way to the back and bring the photo (passive) button forward. It’s done!

Preview the completed buttons.

In the Application bar, go to Window > File > Export > Save as type: Adobe PDF (interactive). View the PDF. The hover effect should work as expected in both active and passive states.

Repeat these steps as necessary for more buttons!

Here is a summary of the actions needed for each active and passive button pair. Note the order of the steps. Also note how the visibility changes for passive and active buttons are inverse. Alternatively, you can always copy-paste your first button and simply update links and text, too.

Step State Image/Button Event Action Visibility Change
1
Active
Byline
On Roll Over
Show/Hide Buttons and Forms
Ignore all
2
Passive
Photo
On Roll Over
Show/Hide Buttons and Forms
Hide itself
3
Passive
Photo
On Roll Over
Show/Hide Buttons and Forms
Ignore all
4
Active
Byline
On Roll Over
Show/Hide Buttons and Forms
Show its matching photo (passive) button

This interactive rollover mimics the hover effects encountered in web design. Now your interactive PDFs made in InDesign possess the same capability.

Troubleshooting:

Interactive PDFs may fail to show the photo (passive) button, even when both buttons and all actions are applied, if buttons and actions weren’t entered in a very particular order.

For whatever reason, InDesign requires the button and actions to be made in a particular order. Deviating from this order resulted in the photo failing to show, hover or not. If the test PDF runs like this, correct this problem by converting both buttons back to objects using the “Convert to Object” icon in the Buttons and Forms panel, then converting them back to into buttons again. Add actions in this particular order: create the byline (active) button first, add only its roll over action, then create the photo (passive) button and both of its actions, before finally returning to add the roll off to the byline (active) button.

The Window > Interactive > SWF Preview panel may give “false positives” when testing the buttons. Buttons may appear to work in this window but fail to work in the actual interactive PDF. Be sure to rely on actual exported interactive PDFs for the most accurate testing.