Search documentation of Plushie

# Plushie.Command.Scroll (Plushie v0.7.2)

Copy Markdown View Source

Scroll commands: absolute, relative, and snap positioning.

All functions support window-qualified paths (`"window#widget"`).

## Example

    def update(model, %WidgetEvent{type: :click, id: "to-top"}) do
      {model, Command.Scroll.snap_to("main#content", 0.0, 0.0)}
    end

## Summary

### Functions

scroll_by(widget_id, x, y)

Sends the `scroll_by` command to the widget.

scroll_to(widget_id, x, y)

Sends the `scroll_to` command to the widget.

snap_to(widget_id, x, y)

Sends the `snap_to` command to the widget.

snap_to_end(widget_id)

Sends the `snap_to_end` command to the widget.

## Functions

# scroll_by(widget_id, x, y)

    @spec scroll_by(String.t(), number(), number()) :: Plushie.Command.t()

Sends the `scroll_by` command to the widget.

# scroll_to(widget_id, x, y)

    @spec scroll_to(String.t(), number(), number()) :: Plushie.Command.t()

Sends the `scroll_to` command to the widget.

# snap_to(widget_id, x, y)

    @spec snap_to(String.t(), number(), number()) :: Plushie.Command.t()

Sends the `snap_to` command to the widget.

# snap_to_end(widget_id)

    @spec snap_to_end(String.t()) :: Plushie.Command.t()

Sends the `snap_to_end` command to the widget.