Enhancement request - Improve support for running inside an iFrame #1117
-
Hi Today when running inside an iFrame, lightGallery fills the iFrame window area with the gallery. This does not work well when the iFrame is "larger" than the parent window. For example: Result - lightGallery will create a 10000px tall gallery area Both lead to a poor user experience since the photo to display is not visible (until you scroll down). Currently, I'm trying to work around it by setting the iFrame height to the window.parent height before opening the gallery. Then in onCloseAfter.lg restoring the iFrame height back to the original height. However, lightGallery is no longer responsive to the user changing the height of the browser window. Any suggestions on how to make lightGallery work better in iFrames? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Do you have a demo where I can reproduce the issue? You can set iframe width and height using Also, to set the correct height and width when the lightGallery container is resized you can use the |
Beta Was this translation helpful? Give feedback.
Do you have a demo where I can reproduce the issue?
You can set iframe width and height using
iframeHeight
andiframeWidth
settings respectively https://www.lightgalleryjs.com/docs/settings/#iframeHeightAlso, to set the correct height and width when the lightGallery container is resized you can use the
lgContainerResize
event and modify values - https://www.lightgalleryjs.com/docs/events/#lgContainerResize