Skip to content

Responsive option #39

Open
Open

Description

@troyericg

In addition to the full screen and fixed options, is there a way to offer a viewer option that takes the width of its parent element (calculating an appropriate height from that value)?

We’ve run into an issue on our site now where the Viewer doesn’t fit in with our current responsive grid. I wrote a tiny function to calculate the width/height and pass it to the .load() method, but I’m hoping we can drop this hack at some point.

Activity

  1. jashkenas commented on Apr 4, 2014

    @jashkenas
    Member

    I think it would make a nice compliment to the current "fixed size", and "full page" options.

    Fixed size makes sense when you have a static site layout, or to embed within a larger article.

    Full page makes sense when you have a dedicated docviewer page you've designed, with a thin wrapper...

    But a "responsive" option would work well for any site that has their articles and interactive pages embedded within a responsive layout. The document viewer would simply create itself at the width of it's parent element, and then set a height proportional to a standard page, based on that width. It would then listen to resize window events, and resize itself using that same math if the parent element's width had changed.

  2. jheasly commented on Jan 8, 2015

    @jheasly

    A +1 on this. (Doesn't seem to have been implemented, that I can find.)

  3. jheasly commented on Jan 9, 2015

    @jheasly

    ... But! Adding responsive: true to the embed options seems to work great! As found here:
    https://twitter.com/documentcloud/status/542749083371180033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions