package ocsigen-toolkit

All checked builds pass
  1. Overview
  2. Docs
Reusable UI components for Eliom applications (client only, or client-server)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

5.0.0.tar.gz
md5=94767ed327f1b17bdf81bb6eae92d8da
sha512=86e2522ed7f9f1aba2da9f2dec7bb764aa1357fe48d560da5565d8e77d8307ba14f9637a1025c010acf9c77c8e8bfd59c0672be7d9da59ea4520ebac24ea2314

doc/ocsigen-toolkit.server/Ot/Swipe/index.html

Module Ot.Swipe

val bind : ?transition_duration:float -> ?min:(unit -> int) Eliom.Client_value.t -> ?max:(unit -> int) Eliom.Client_value.t -> compute_final_pos: (Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t -> int -> int) Eliom.Client_value.t -> ?onstart: (Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t -> int -> unit) Eliom.Client_value.t -> ?onmove: (Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t -> int -> unit) Eliom.Client_value.t -> ?onend: (Js_of_ocaml.Dom_html.touchEvent Js_of_ocaml.Js.t -> int -> unit) Eliom.Client_value.t -> Html_types.div_content Eliom.Content.Html.elt -> unit

bind ~compute_final_pos elt makes elt left-right swipable on touch screens. compute_final_pos is a function that will compute the final position of the element w.r.t. the position where it has been released (in pixels). Use (fun _ p -> p) if you want it to stay where it was released.

Use ?min and ?max if you want to limit the move. If outside range, events will be propagated to parent (which makes it possible to have a swipeable element inside another one).

?onstart and ?onmove and ?onend can be used to execute some side effect on touch start, touch move and touch end. The second parameter is the current move.