# Overflow

It is possible to have infinite scrolling pages inside an overflow element.

First define a container element.

```html
<div id="scroller">
    <div class="item">Item 1</div>
    <div class="item">Item 2</div>
    <!-- more items -->
</div>
```

Then configure the overflow using css. Don't forget to give the element a fixed height.

```css
#scroller {
  overflow: scroll;
  height: 200px;
}
```

Then configure the element as scroll container.

```javascript
let ias = new InfiniteAjaxScroll('#scroller', {
  scrollContainer: '#scroller'
});
```

[View this behaviour in a live demo](https://infiniteajaxscroll.com/examples/overflow/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infiniteajaxscroll.com/advanced/overflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
