i'm using iframe-resizer adjust height of iframe content's height. far working great, have 1 issue witdh. when loaded, takes screen width set iframe, that's ok desktop size screen mobile i'd allow scrolling on x-axe. suggestions?
here's iframeresize initialization:
if (document.getelementbyid('iframe')){ $('iframe').iframeresize({ autoresize: true, scrolling: false, maxwidth: screen.width, sizewidth: true, //widthcalculationmethod: 'taggedelement', checkorigin: [reports_server], //log: true }); }
and here's css:
.iframe-content{ /* min-width: 800px; min-height: 640px;*/ width: -moz-available; width: 100% !important; /*height: 100%;*/ overflow-y: hidden; } @media (max-width : 768px) { .iframe-content{ overflow-x: scroll !important; } }
and html part iframe:
<iframe title="myiframe" id="iframe" class="iframe-content" src="mysource" scrolling="no"></iframe>
you can set minwidth in iframe-resizer.
https://github.com/davidjbradshaw/iframe-resizer#minheight--minwidth