package js_of_ocaml
Compiler from OCaml bytecode to JavaScript
Install
Dune Dependency
Authors
Maintainers
Sources
js_of_ocaml-5.7.1.tbz
sha256=0ea48e2aa8904ec562f225fa093ff674b54e0e7514dae8627b8fd8f77210383d
sha512=c6df6875631d0f7e647e31dff26da696869e83391a1040461445d2ed895985f83f60acdd045b773f05c955e3d61cee10491d947df6071637e1bb65cd373d6285
doc/js_of_ocaml/Js_of_ocaml/MutationObserver/index.html
Module Js_of_ocaml.MutationObserver
Source
MutationObserver API
A code example:
if (MutationObserver.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 records observer =
Firebug.console##debug records ;
Firebug.console##debug observer
in
MutationObserver.observe ~node ~f
~attributes:true ~child_list:true ~character_data:true
()
Source
val mutationObserver :
((mutationRecord Js.t Js.js_array Js.t ->
mutationObserver Js.t ->
unit)
Js.callback ->
mutationObserver Js.t)
Js.constr
Source
val observe :
node:Dom.node Js.t ->
f:(mutationRecord Js.t Js.js_array Js.t -> mutationObserver Js.t -> unit) ->
?child_list:bool ->
?attributes:bool ->
?character_data:bool ->
?subtree:bool ->
?attribute_old_value:bool ->
?character_data_old_value:bool ->
?attribute_filter:Js.js_string Js.t list ->
unit ->
mutationObserver Js.t
Helper to create a new observer and connect it to a node
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>