package bonsai
A library for building dynamic webapps, using Js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
bonsai-v0.16.0.tar.gz
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303
doc/bonsai.web_ui_scroll_utilities/Bonsai_web_ui_scroll_utilities/index.html
Module Bonsai_web_ui_scroll_utilities
Source
Source
val to_position_inside_element :
?smooth:bool ->
selector:string ->
x_px:int ->
y_px:int ->
[ `Minimal | `To_bottom | `To_top ] ->
unit Core.Or_error.t Bonsai_web.Effect.t
Scrolls to a position inside an element found by the provided selector. The target element must be relatively or absolutely positioned.
Returns a unit Or_error.t Effect.t
that will be an error if the element picked by "selector" can't be found.
`Minimal, `To_bottom, and `To_top are used to determine where the chosen pixel would end up inside the scrolling container after the scrolling is finished.
Source
val into_view :
?smooth:bool ->
selector:string ->
[ `Minimal | `To_top | `To_bottom ] ->
unit Core.Or_error.t Bonsai_web.Effect.t
Similar to the above function, but instead of scrolling to a position, it scrolls to a specific element
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>