Page 1 of 1
iframes, full height, no scroll - how do you do it?
Posted: Thu Nov 24, 2016 4:33 pm
by simonmlewis
We are developing some work so that the client can take the iframe code, and pop it into a page, so the page loads embedded. However, we don't want there to be any scrolling. It needs to look like it is part of the page. So that whatever is in the page, expands the iframe.
The main issue is, we have no control over the "outside" of the iframe, as the system it's going in doesn't allow additional <script>.
We cannot set a height to the iframe, because if it's wrong, then there will either be a huge gap at the bottom, or still a scroll.
Can it be done??
Re: iframes, full height, no scroll - how do you do it?
Posted: Tue Nov 29, 2016 2:43 am
by thinsoldier
I think the only way would be for the page consuming the iframe to have script on it that can receive info from your page within the iframe. There's also some new html5 features ( I don't know how well supported ) planned that are supposed to make the page within an iframe automatically blend seamlessly with the host page. That requires some new attributes on the <iframe> tag itself so again it's up to the owner of the host page to include those attributes (if they are even supported yet).
You could give it a default height have some JS based scrolling that looks nicer than the default scroll bar. But again the owner of the host page can choose to remove your height and no-scrolling attributes.
But if the owner of the page using the iframe cares about it looking nice it only take a tiny bit of js to make it happen:
http://stackoverflow.com/questions/9975 ... hout-using
Re: iframes, full height, no scroll - how do you do it?
Posted: Tue Nov 29, 2016 2:53 am
by simonmlewis
What if you cannot add code to the host page? Only embed the iframe.
Re: iframes, full height, no scroll - how do you do it?
Posted: Tue Nov 29, 2016 6:59 am
by Celauran
Then there's not much you can do and, I would argue, it's not even your problem.
Re: iframes, full height, no scroll - how do you do it?
Posted: Tue Nov 29, 2016 7:45 am
by simonmlewis
We want to, so we can add iframe code to ebay, and have it expand to fit the content. Sounds like this isn't possible.
Re: iframes, full height, no scroll - how do you do it?
Posted: Fri Dec 02, 2016 6:30 pm
by thinsoldier
simonmlewis wrote:We want to, so we can add iframe code to ebay, and have it expand to fit the content. Sounds like this isn't possible.
A simple e-mail to someone in support or developer outreach at e-bay asking "Will you allow us to do this thing with iframes?" would have gotten you a quick yes or no or suggestion of things they would allow you to do that you might not have thought of yet.