Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
I'd like to use a slider with desktop scaling, but I'd like to make the maximum width a percentage of the overall viewport. Is that possible?
in how_to by (1.1k points)
  

1 Answer

0 votes
 
Best answer

If I understand what you want, you can create 2 documents and use the in5 Web Content Interactive Widget to insert your main content into the other one at the percentage that you want. Here's how you would do it:

  1. Create your main content and export it using the Slider format with Desktop Scaling.
  2. Make another document with one page.
  3. Make a rectangle the same size as the document, select it, and use InDesign to calculate the percentage for you in the Width and Height fields.
  4. Select the rectangle and go to in5 > Interactive Widgets > Web Content.
  5. In the Web Content dialog, navigate to the main content that you exported in step 1.
  6. Export this document using the Slider format with Desktop Scaling.
by (8.5k points)
selected by
Thanks Myra, I can see how this would work. I was hoping there might be a css or javascript solution along the lines of maxWidth=75% or something similar. I thought I saw something like that when searching answers here.

If not I know I have this solution, so thank you!

Awesome. I'm glad I could help.

Was this the JavaScript that you were looking for to add to the Resources section:
Set a maximum height or width for Desktop Scaling

Yes that was it! I thought I was adding my question to that one but I must have gotten my tabs mixed up :)

What do you think? Is there a solution for my question in using this Javascript? I would still want to have my content vertically centered in the browser window, I just don't want it to be edge-to-edge.

Thanks Myra!
I don't think you could do it with just that code. That code sets a maximum width so that the content does scale wider than the width indicated. It isn't a percentage of the viewport.