package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
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.

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

OCaml

Innovation. Community. Security.