Js_of_ocaml.ResizeObserver
ResizeObserver API
A code example:
if (ResizeObserver.is_supported ()) then
let doc = Dom_html.document in
let target =
Js.Opt.get (doc##getElementById (Js.string "observed"))
(fun () -> assert false)
in
let node = (target :> Dom.node Js.t) in
let f entries observer =
Firebug.console##debug entries;
Firebug.console##debug observer
in
ResizeObserver.observe ~node ~f
~box:(Js.string "content-box")
()
class type resizeObserverSize = object ... end
class type resizeObserverEntry = object ... end
class type resizeObserverOptions = object ... end
class type resizeObserver = object ... end
val empty_resize_observer_options : unit -> resizeObserverOptions Js.t
val resizeObserver : ((resizeObserverEntry Js.t Js.js_array Js.t -> resizeObserver Js.t -> unit) Js.callback -> resizeObserver Js.t) Js.constr
val observe : node:Js_of_ocaml__.Dom.#node Js.t -> f:(resizeObserverEntry Js.t Js.js_array Js.t -> resizeObserver Js.t -> unit) -> ?box:Js.js_string Js.t -> unit -> resizeObserver Js.t
Helper to create a new observer and connect it to a node.