I am working with a dashboard (background image with a series of controls and charts/graphs) that was originally rendered at 1920x1080. This dashboard needs to be viewed within the contents of an iFrame (so that it can be embedded into 3rd party portal page).
Rigth now, on the HTML doc that has the iFrame (depending on what resolution a client is using), I am using the following code:
<style>
#wrapper { width: 1440px; height: 910px; padding: 0; overflow: hidden;
display: block;
margin-left: auto;
margin-right: auto; }
#scaled-frame { width: 1930px; height: 1200px; border: 0px; }
#scaled-frame {
zoom: 0.75;
-moz-transform: scale(0.75);
-moz-transform-origin: 0 0;
-o-transform: scale(0.75);
-o-transform-origin: 0 0;
-webkit-transform: scale(0.75);
-webkit-transform-origin: 0 0;
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
#scaled-frame { zoom: 1; }
}
</style>
<div id="wrapper"><iframe id="http://url-to-iFramepage.html"></iframe></div>
I keep a number of different iterations of this file for various resolutions (scaling more and more for lower resolutions), so when a user wants to embed the dashboard into their portal page, I refer them to the appropriate .html file (each file having different scaling settings).
Is there any way to perform the type of scaling above in a more dynamic way? In a perfect world, depending on the iFrame size, the scaling factors would automatically adjust. It doesn't matter if the solution is css or javascript or whatever...if I can get that to work, it would save a lot of headaches.
I have looked at a TON of different posts (which gave me the initial code I'm using, but I can't seem to get any of the suggested dynamic methods to work with this content. I am also not very handy with HTML and JavaScript, so an answer may well be readily available but I just don't see it.
Thank you in advance for any help.