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
  • constructor
  • bind
  • unbind
  • next
  • load
  • append
  • enableLoadOnScroll
  • disableLoadOnScroll

Was this helpful?

  1. Reference

Methods

constructor

argument
type
description

container

string|Element

options

object

// import if you use the NPM package (not needed if you use CDN)
import InfiniteAjaxScroll from '@webcreate/infinite-ajax-scroll';

let ias = new InfiniteAjaxScroll('.container', {
  item: '.item',
  next: '.next',
  pagination: '.pagination'
});

bind

This will bind Infinite Ajax Scroll to the scroll and resize events of the scroll container.

unbind

This will unbind Infinite Ajax Scroll from the scroll and resize events of the scroll container.

next

This will load the next page manually.

load

argument
type
description

url

string

Url to load

ias.load('http://my-domain.test/page1.html')
  .then((loadedEvent) => {
    console.log('Requested ' + loadedEvent.url + ' successfully');
  })
  .catch((xhr) => {
    console.log('Request failed with ' + xhr.status + ' (' + xhr.statusText + ')');
  });

append

Use this method to append an array of items to the container.

It will return a promise.

argument
type
description

items

array

Array of element to append to the container

parent

Element|null

enableLoadOnScroll

disableLoadOnScroll

PreviousOptionsNextEvents

Last updated 2 years ago

Was this helpful?

Selector or Element of the container (see )

Configuration for this instance of Infinite Ajax Scroll (see )

This wil load an url and returns a promise which represents the event.

If the request fails, the promise will be rejected with the object.

Container to append to. When none given it falls back to the

Enables the setting on runtime.

Disables the setting on runtime.

XMLHttpRequest
definitions/concepts
options
configured container
loaded
loadOnScroll
loadOnScroll