package fmlib_js
Library for easy compilation from ocaml to javascript
Install
Dune Dependency
Authors
Maintainers
Sources
0.5.0.tar.gz
sha256=994eefac793a19fc7495756089d383d8b87623863ebee4e79941f30f7f60cae3
md5=6c083a2187edf29ca1920630a776071e
doc/fmlib_js/Fmlib_js/Dom/Node/index.html
Module Dom.Node
A node in the dom tree.
val event_target : t -> Event_target.t
The node viewed as an event target.
apppend child parent
Append child
to the end of the children of parent
If child
is already a child of another node, it is removed from the other node. A node can be a child of only one parent node.
remove child parent
Remove child
from parent
Precondition: child
must be a child of parent
.
If you are not sure that child
belongs to parent
, get parent child
and check (by physical equality ==
) that the computed parent and parent
are the same.
Procedure to remove all children from a node:
let rec remove_children (node: t): unit =
match first node with
| None ->
()
| Some child ->
remove child node;
remove_children node (* tail recursion, compiled to a
javascript loop. *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>