Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

pagination.js example codepen

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>pagination example</title>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/paginationjs/2.1.4/pagination.min.js"></script>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/paginationjs/2.1.4/pagination.css"/>
</head>
<body>

<div>
    <section>
        <div id="data-container"></div>
        <div id="pagination"></div>
    </section>
</div>

<script>
    $(function () {
        let container = $('#pagination');
        container.pagination({
            dataSource: [
                {name: "hello1"},
                {name: "hello2"},
                {name: "hello3"},
                {name: "hello4"},
                {name: "hello5"},
                {name: "hello6"},
                {name: "hello7"},
                {name: "hello8"},
                {name: "hello9"},
                {name: "hello10"},
                {name: "hello11"},
                {name: "hello12"},
                {name: "hello13"},
                {name: "hello14"},
                {name: "hello15"},
                {name: "hello16"},
                {name: "hello17"},
            ],
            callback: function (data, pagination) {
                var dataHtml = '<ul>';

                $.each(data, function (index, item) {
                    dataHtml += '<li>' + item.name + '</li>';
                });

                dataHtml += '</ul>';

                $("#data-container").html(dataHtml);
            }
        })
    })
</script>
</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: lenght validation using jquey valisaton 
Javascript :: ckeditor config 
Javascript :: sort array without mutating js 
Javascript :: string charat javascript 
Javascript :: node global directory windows 
Javascript :: javascript check if consecutive array 
Javascript :: for in javascript 
Javascript :: javascript beginning of today and yesterday 
Javascript :: js return the highest and lowest number 
Javascript :: jwt 
Javascript :: console.log 
Javascript :: transform date to relative date js 
Javascript :: libuv nodejs 
Javascript :: Unable to resolve "@react-native-community/masked-view" from 
Javascript :: how to edit message discord.js 
Javascript :: variable javascript 
Javascript :: react big calendar messages 
Javascript :: how to create component in reactjs 
Javascript :: javascript get cpu cores 
Javascript :: js change classlist 
Javascript :: quiz javascript example with array 
Javascript :: password reset passport-local mongoose 
Javascript :: subset in js 
Javascript :: array remove first element js 
Javascript :: js jwt decode 
Javascript :: javascript Set Difference Operation 
Javascript :: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. 
Javascript :: array length in javascript 
Javascript :: js round 2 decimals 
Javascript :: node fs existssync 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =