-1

I have a news section on a page, when i click on a news a fancybox iframe is opened showing the news page.

The news page contains 3 images on top ad some text on the body of the page, and on page load i create a new Swiper slider with the images. Unfortunately on iOS Safari, creating the slider with those images make the content of the iframe being incorrectly sized.

This behaviour only happens on iOS Safari because if i test in chrome with device toolbar enabled everything works as expected.

I've attached a video of the issue at this link

Tiziano
  • 316
  • 1
  • 4
  • 17

1 Answers1

0

First, fancybox works fine. The script attaches load event to iframe element and then (inside that event) reads width/height of body element and uses these values to resize iframe parent element so that iframe dimensions matches page size.

If you (or some 3rd party script) change layout, then, obviously, page dimensions will change, too. In that case, you can execute parent.jQuery.fancybox.getInstance().update(); (from within iframed page) to call update method that will do resizing again.

Janis
  • 8,593
  • 1
  • 21
  • 27