Skip to content

Commit 0086a31

Browse files
committed
Workaround for shaking transition on Safari (iOS 11.2.2)
1 parent 48f44aa commit 0086a31

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/widgets/ot_carousel.eliom

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,11 @@ let%client remove_transition elt =
5656

5757
let%shared default_make_transform ~vertical ?(delta = 0) pos =
5858
let p = -pos * 100 in
59-
let sign = if delta > 0 then "+" else "-" in
60-
let d = abs delta in
6159
if vertical
6260
(* then Printf.sprintf "translate3d(0, %.3f%%, 0)" d *)
6361
(* else Printf.sprintf "translate3d(%.3f%%, 0, 0)" d *)
64-
then Printf.sprintf "translate(0, calc(%d%% %s %dpx)" p sign d
65-
else Printf.sprintf "translate(calc(%d%% %s %dpx), 0)" p sign d
62+
then Printf.sprintf "translateY(%d%%) translateY(%dpx)" p delta
63+
else Printf.sprintf "translateX(%d%%) translateX(%dpx)" p delta
6664
(* translate3d possibly more efficient on some devices ... *)
6765
(* But causing troubles ...
6866
For example some content cannot have border-radius on Chrome ... *)

0 commit comments

Comments
 (0)