Issues with 3d automatic transformation #466
-
Hola, I made a custom slider that only works with API (no drag) that has a class system to determine the position and rotation of my slides. When I first load the page the slider works with no problems. If I resize the page, embla adds a 3d tranfsormation on the style of the container and sometimes on the children slides that messes up with all the custom transformations. I managed to remove the style attribute on the container on resize, but the same script doesn't work with children slides. That's the custom hook I am using
Is it possible to deactivate the 3d translation? Thanks in advance for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @bloodylupin, Embla reads slide sizes when it initializes and when sizes change. For this to work properly you need to disable any transforms on your slides and container that affects their sizes or positions before it re-initializes (for example, when resized). One example that solves this is the iOS picker on the examples page. It disables Embla transforms. Look for the The order of things that need to happen has to be the following on every re-initialization or resize:
Please note that the examples are using the latest version of Embla which is v8.0.0-rc01. The new Best, |
Beta Was this translation helpful? Give feedback.
Hi @bloodylupin,
Embla reads slide sizes when it initializes and when sizes change. For this to work properly you need to disable any transforms on your slides and container that affects their sizes or positions before it re-initializes (for example, when resized).
One example that solves this is the iOS picker on the examples page. It disables Embla transforms. Look for the
disableEmblaTransform
function or similar.The order of things that need to happen has to be the following on every re-initialization or resize:
embla.reInit()
.