Skip to main content
ashimg23377171
Inspiring
October 16, 2019
Answered

how to change background color / opacity of a box when the user hovers over it

  • October 16, 2019
  • 6 replies
  • 2274 views

Hi

I am working on an InDesign document for digital publication, that is, a pdf.

 

I wish to have a box with some text in it. I wish to know if there is a way in InDesign to change the background color \ opacity of the box when the user hovers over it.

 

Something like the below, which is accomplished in CSS:

.btn: hover {

opacity: 0.5

}

 

Thank you.

    This topic has been closed for replies.
    Correct answer Jeffrey_Smith

    6 replies

    Jeffrey_SmithCommunity ExpertCorrect answer
    Community Expert
    October 17, 2019

    ashimg23377171
    Inspiring
    October 18, 2019
    thanks Jeffrey; this is exactly the effect that i desired. thanks so much for pointing it out.
    Community Expert
    October 17, 2019

    Hi Ashim,

    the contents of a state of a button is nothing very special.

    Just plain InDesign objects like perhaps in your case a text frame or a rectangle embedded in a group that is visible as state in the Layers panel.

     

    You can direct access them on the page, click through with cmd + click ( Mac OS X ) or Ctrl + click ( Windows ) or use Shift + Esc key if the button's state is the active one or through the Layers panel if you want to select them. Once selected you could change fill color. Edit text. Or change opacity of the fill through the Effects panel.

     

    Regards,
    Uwe Laubender

    ( ACP )

    Community Expert
    October 16, 2019

    The text frame needs to be converted to a button first. Contextually (right mouse select) the frame: Interactive > Convert to Button. Open [Buttons and Forms] panel, there you can set the appearance for Normal, Rollover, and Click.

    ashimg23377171
    Inspiring
    October 17, 2019

    thanks everyone. But now with the rollover, i do not see any action that could affect the opacity of the box / button i wish to change. any thoughts on how this can be accomplished.

     

    Thank you.

    Derek Cross
    Community Expert
    Community Expert
    October 16, 2019

    Multi-state buttons won't work on Interactive PDFs use FXL ePub, Publish Online or in5 for this festure to work successfully on most devices.

    Community Expert
    October 16, 2019

    That said: You could test something with the [Rollover] state of a button object in InDesign.

    Then export as PDF Interactive.

     

    But, as I said, not every PDF viewer can visualize this file successfully.

    In fact you can only be sure with Adobe Reader and Acrobat Pro DC on Windows and Mac OS X.

    No other device, no other operating system, no other reader application.

     

    Regards,
    Uwe Laubender

    ( ACP )

    ashimg23377171
    Inspiring
    October 16, 2019
    got it, Uwe. thanks for that. i will give that a try.
    Community Expert
    October 16, 2019

    Hi Ashim,

    what's your PDF viewer application?

     

    If unknown, there is no way to guaranty that any method will work.

    I'd say you cannot do it with InDesign. You have to edit the PDF with Acrobat Pro DC and look after a way doing this with Acrobat's JavaScript.

     

    With a HTML based export there could be a way. PDF is problematic.

     

    Regards,
    Uwe Laubender

    ( ACP )