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

Why does the container appear, then resize? #868

Open
MrAnalogy opened this issue Sep 13, 2018 · 4 comments
Open

Why does the container appear, then resize? #868

MrAnalogy opened this issue Sep 13, 2018 · 4 comments

Comments

@MrAnalogy
Copy link

I noticed that the container for the "popup" appears on the screen empty, then it resizes with content.

I tried to follow the code but my .js skills are pretty poor.

Is it necessary to have it visible before resizing it?
(I'm guessing maybe it has to be visible to resize to it's contents).

Thanks!

@jackmoore
Copy link
Owner

That's correct, I can't really measure the dimensions until the content is in the document flow. However, I could have done a better job avoiding this for inline content since that would be immediately available to measure on opening. Sorry about that. The real issue was not knowing what size asynchronously loaded content would be, such as ajax and images.

You can avoid the transition by setting the transition property to none, or by setting the initialWidth and initialHeight values to match the size of your content.

@MrAnalogy
Copy link
Author

MrAnalogy commented Sep 17, 2018 via email

@jackmoore
Copy link
Owner

See my previous suggestion about using transition: 'none' or setting the initialWidth/initialHeight sizes. Example:

<a href="#" onclick='$.colorbox({iframe:true, initialWidth: "80%", initialHeight: "90%", width:"80%",
height:"90%",transition:"elastic", href:"//www.BungalowSoftware.com"});' >Launch page in iframe</a>

Or

<a href="#" onclick='$.colorbox({iframe:true, width:"80%",
height:"90%",transition:"none", href:"//www.BungalowSoftware.com"});' >Launch page in iframe</a>

@jackmoore
Copy link
Owner

However, I agree this shouldn't be necessary for immediately loaded content (like inline or iframe). Sorry for the workaround.

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

2 participants