Skip to content

klocus/load-more

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load More!

Simple jQuery plugin that downloads remote content by AJAX on scroll or on button click.

Options

Name Type Default Description
containerSelector string #posts A container in which dynamic content appears.
loadingSelector string #loading Loading element.
requestUrl string objects.php?page= An address that will return dynamic HTML content.
requestOnStart boolean true Loads dynamic content as soon as the page loads.
requestOnScroll boolean false Loading dynamic content with page scrolling down.
pagesCount integer 0 The maximum number of pages. By default, no limit.
onComplete function null A function that is performed after loading dynamic content.

Using

Without options

<script>
    $('#button-selector').loadMore();
</script>

With options

<script>
    $('#button-selector').loadMore({
        containerSelector: '#posts',
        requestUrl: 'objects.php?page=',
        requestOnStart: true,
        requestOnScroll: false,
        loadingSelector: '#loading',
        onComplete: function() {
            alert('Hello World!');
        }
    });
</script>

About

Simple and lightweight jQuery plugin that downloads remote content by AJAX on scroll or on button click.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published