Infinite Ajax Scroll
  • Overview
  • Installation
  • Getting started
  • License
  • Support
  • Reference
    • Options
    • Methods
    • Events
  • Advanced
    • Triggers
    • Last page message
    • History
    • Overflow
    • Upward scroll
Powered by GitBook
On this page

Was this helpful?

  1. Advanced

Overflow

PreviousHistoryNextUpward scroll

Last updated 2 years ago

Was this helpful?

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

First define a container element.

<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.

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

Then configure the element as scroll container.

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

View this behaviour in a live demo