I have this carousel that rotates in 3D using -webkit-transform: rotateX(rotation in deg);. It has 10 panels, which means that every 36 degrees there is a panel with a center.
Now I'm trying to create an “snap to” effect caused by the event touchendby setting the closest panel centered in front.
My problem is that from an arbitrary rotation value, for example, -1820 degrees, how can I calculate which panel, or, more precisely, to what extent the nearest panel?
Hope this makes sense. A tip would be greatly appreciated.
source
share