Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iframe size not initiated before content load #365

Open
tawgul opened this issue Jun 22, 2018 · 4 comments
Open

Iframe size not initiated before content load #365

tawgul opened this issue Jun 22, 2018 · 4 comments

Comments

@tawgul
Copy link

tawgul commented Jun 22, 2018

Hi.

When you set up data-featherlight-iframe-width and data-featherlight-iframe-height it should take the size into account when the modal window appears not after the external content is loaded..
So first we have the size we want and then content loads in.
The modal container could change the size at first to have the space required for iframe.

@alanef
Copy link

alanef commented Sep 5, 2019

a loading attribute is supported

data-featherlight-loading='any html can go here'

without this you get the small modal before content is loaded

if you add appropriate html to loading you can create an appropriately sized modal

e.g.

data-featherlight-loading="<div style='width:400px;height:600px;text-align:center'> <img src='loading placeholder image'> </div>

Or similar html to meet your needs

@PhilippGrashoff
Copy link

PhilippGrashoff commented Nov 8, 2019

I fixed this by defining the size of the Iframe using iframeStyle to add CSS via the style attribute of the iframe tag:
data-featherlight-iframe-style="width:95vw;max-width:1200px;height:90vh;border-radius:4px"

If you want to pass it as configuration, its named iFrameStyle:

 {
        type:           'iframe',
        iframeStyle:    'width:95vw;max-width:1200px;height:90vh;border-radius:4px',
        iframeWidth:    '',
        iframeHeight:   ''
}

When adding CSS width and height, the Iframe has this size the moment it appears on screen.

@kevin-j-morse
Copy link

@PhilippGrashoff what did you do about the inital size of the modal?

Also have you noticed there are some inconsistencies between the sizing of the two stages of the featherlight box?

Even if I specify

iframeStyle: 'width:400px;height:600px;',
loading: "<div style='width:400px;height:600px;'></div>",

I still see an abrupt transition when the iframe loads and the size of the box is changing.

@PhilippGrashoff
Copy link

@kevin-j-morse unfortunately I did not get a proper solution for that yet. I do not use any loading information and the change of size when the Iframe is completely loaded is not too much in my case.
Yet, I would love to have a solution for that!
I also move the closing Icon above the modal using CSS, but thats not causing the size change.
If you have any point to start from, please tell me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants