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

unable to get iframe to maximise all the available space #859

Open
mosesliao opened this issue May 26, 2018 · 4 comments
Open

unable to get iframe to maximise all the available space #859

mosesliao opened this issue May 26, 2018 · 4 comments

Comments

@mosesliao
Copy link

mosesliao commented May 26, 2018

I am using this script on my webapp

<script type='text/javascript'>
  $(document).ready(function() {
    $(".map").colorbox({width: '90%', height: '80%', iframe: 'true', maxWidth: '100%'});
  });
</script>

but unfortunately I get this. the map is too small on the top left hand corner.

may-26-2018 15-32-20

how should I fine tuned my javascript so that the map can show properly?

@jackmoore
Copy link
Owner

Does the same thing happen if you set the transition to "none"?

<script type='text/javascript'>
  $(document).ready(function() {
    $(".map").colorbox({width: '90%', height: '80%', iframe: 'true', maxWidth: '100%', transition: "none"});
  });
</script>

@rtyler
Copy link

rtyler commented Dec 3, 2018

@jackmoore For what it's worth, I believe I have the same issue as @liaogz82, and yes it still happens with transition: 'none'

@rtyler
Copy link

rtyler commented Dec 3, 2018

One workaround I have found is to forcibly set width and heights on the iframe, since it doesn't appear to have them otherwise set.

E.g.

    $(document).bind('cbox_complete', function() {
      	// https://github.com/jackmoore/colorbox/issues/859
        $('.cboxIframe').attr('width', '100%').attr('height', '95%')
    });

@AntaeusNar
Copy link

I was having a similar issue, and then realized I had not loaded colorbox.css. Correcting that fixed the issue.

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