colorbox icon indicating copy to clipboard operation
colorbox copied to clipboard

unable to get iframe to maximise all the available space

Open mosesliao opened this issue 6 years ago • 4 comments

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?

mosesliao avatar May 26 '18 07:05 mosesliao

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>

jackmoore avatar May 26 '18 16:05 jackmoore

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

rtyler avatar Dec 03 '18 23:12 rtyler

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%')
    });

rtyler avatar Dec 03 '18 23:12 rtyler

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

AntaeusNar avatar May 08 '19 02:05 AntaeusNar