---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://divkit.tech/docs/en/concepts/divs/2/div-action-scroll-by.md
  - https://divkit.tech/docs/ru/concepts/divs/2/div-action-scroll-by.md
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/en/llms.txt

# div-action-scroll-by
Scrolls the container by `item_count` or `offset` starting from the current position. If both values are specified, the action will be combined. For scrolling back, use negative values.

## Parameters
| Parameters | Description |
| --- | --- |
| `id` | <p>**string**</p><p>Required parameter.</p><p>ID of the element where the action should be performed.</p><p>Available platforms: Android, iOS, web.</p> |
| `type` | <p>**string**</p><p>Required parameter.</p><p>The value must always be `scroll_by`.</p><p>Available platforms: Android, iOS, web.</p> |
| `animated` | <p>**bool**</p><p>Enables scrolling animation.</p><p>Default value: `true`.</p><p>Available platforms: Android, iOS, web.</p> |
| `item_count` | <p>**int**</p><p>Number of container elements to scroll through. For scrolling back, use negative values.</p><p>Default value: `0`.</p><p>Available platforms: Android, iOS, web.</p> |
| `offset` | <p>**int**</p><p>Scrolling distance measured in `dp` from the current position. For scrolling back, use negative values. Only applies in `gallery`.</p><p>Default value: `0`.</p><p>Available platforms: Android, iOS, web.</p> |
| `overflow` | <p>**string**</p><p>Defines navigation behavior at boundary elements:<li>`clamp`: Stop navigation at the boundary element (default)</li><li>`ring`: Navigate to the start or end, depending on the current element.</li></p><p>Possible values: `clamp`, `ring`.</p><p>Default value: `clamp`.</p><p>Available platforms: Android, iOS, web.</p> |

<details>
<summary>JSON</summary>

```json
{
  type*: "scroll_by",
  animated: "bool",
  id*: "string",
  item_count: "int",
  offset: "int",
  overflow: "string"
}
```
</details>
