You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Activity
jashkenas commentedon Apr 4, 2014
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.
jheasly commentedon Jan 8, 2015
A +1 on this. (Doesn't seem to have been implemented, that I can find.)
jheasly commentedon Jan 9, 2015
... But! Adding
responsive: trueto the embed options seems to work great! As found here:https://twitter.com/documentcloud/status/542749083371180033