Jquery is the framework of javascript. I have only integrated the file. No explanation is given. If you need explanation .Please do comment.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="extra.css">
</head>
<body>
<div class="main">
<div class="para">
<h3>Title1</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title2</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title3</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title4</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title5</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title6</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title7</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title8</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title9</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title10</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title11</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title12</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title13</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title14</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title15</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title16</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title17</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title18</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title19</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title20</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title21</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title22</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title23</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title24</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div class="para">
<h3>Title25</h3>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum, tenetur, unde voluptas corrupti natus odio quidem incidunt nostrum molestias ex libero exercitationem impedit a eveniet similique quasi possimus hic optio.</p>
</div>
<div id="pagination"></div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/simplePagination.js/1.6/jquery.simplePagination.js'></script><script src="extra.js"></script>
</body>
</html>
ul.simple-pagination {
list-style: none;
}
.simple-pagination {
display: block;
overflow: hidden;
padding: 0 5px 5px 0;
margin: 0;
}
.simple-pagination ul {
list-style: none;
padding: 0;
margin: 0;
}
.simple-pagination li {
list-style: none;
padding: 0;
margin: 0;
float: left;
}
span.ellipse.clickable {
cursor: pointer;
}
.ellipse input {
width: 3em;
}
/*------------------------------------*\
Compact Theme Styles
\*------------------------------------*/
.compact-theme span {
cursor:pointer;
}
.compact-theme a, .compact-theme span {
float: left;
color: #333;
font-size:14px;
line-height:24px;
font-weight: normal;
text-align: center;
border: 1px solid #AAA;
border-left: none;
min-width: 14px;
padding: 0 7px;
box-shadow: 2px 2px 2px rgba(0,0,0,0.2);
background: #efefef; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #efefef 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#efefef)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#efefef 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#efefef 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#efefef 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#efefef 100%); /* W3C */
}
.compact-theme a:hover, .compact-theme li:not(.disabled):not(.active) span:hover {
text-decoration: none;
background: #efefef; /* Old browsers */
background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#efefef), color-stop(100%,#bbbbbb)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #efefef 0%,#bbbbbb 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #efefef 0%,#bbbbbb 100%); /* IE10+ */
background: linear-gradient(top, #efefef 0%,#bbbbbb 100%); /* W3C */
}
.compact-theme li:first-child a, .compact-theme li:first-child span {
border-left: 1px solid #AAA;
border-radius: 3px 0 0 3px;
}
.compact-theme li:last-child a, .compact-theme li:last-child span {
border-radius: 0 3px 3px 0;
}
.compact-theme .current {
background: #bbbbbb; /* Old browsers */
background: -moz-linear-gradient(top, #bbbbbb 0%, #efefef 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bbbbbb), color-stop(100%,#efefef)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #bbbbbb 0%,#efefef 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #bbbbbb 0%,#efefef 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #bbbbbb 0%,#efefef 100%); /* IE10+ */
background: linear-gradient(top, #bbbbbb 0%,#efefef 100%); /* W3C */
cursor: default;
}
.compact-theme .ellipse {
background: #EAEAEA;
padding: 0 10px;
cursor: default;
}
/*------------------------------------*\
Light Theme Styles
\*------------------------------------*/
.light-theme span {
cursor:pointer;
}
.light-theme a, .light-theme span {
float: left;
color: #666;
font-size:14px;
line-height:24px;
font-weight: normal;
text-align: center;
border: 1px solid #BBB;
min-width: 14px;
padding: 0 7px;
margin: 0 5px 0 0;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
background: #efefef; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #efefef 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#efefef)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#efefef 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#efefef 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#efefef 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#efefef 100%); /* W3C */
}
.light-theme a:hover, .light-theme li:not(.disabled):not(.active) span:hover {
text-decoration: none;
background: #FCFCFC;
}
.light-theme .current {
background: #666;
color: #FFF;
border-color: #444;
box-shadow: 0 1px 0 rgba(255,255,255,1), 0 0 2px rgba(0, 0, 0, 0.3) inset;
cursor: default;
}
.light-theme .ellipse {
background: none;
border: none;
border-radius: 0;
box-shadow: none;
font-weight: bold;
cursor: default;
}
/*------------------------------------*\
Dark Theme Styles
\*------------------------------------*/
.dark-theme span {
cursor:pointer;
}
.dark-theme a, .dark-theme span {
float: left;
color: #CCC;
font-size:14px;
line-height:24px;
font-weight: normal;
text-align: center;
border: 1px solid #222;
min-width: 14px;
padding: 0 7px;
margin: 0 5px 0 0;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
background: #555; /* Old browsers */
background: -moz-linear-gradient(top, #555 0%, #333 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#555), color-stop(100%,#333)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #555 0%,#333 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #555 0%,#333 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #555 0%,#333 100%); /* IE10+ */
background: linear-gradient(top, #555 0%,#333 100%); /* W3C */
}
.dark-theme a:hover, .dark-theme li:not(.disabled):not(.active) span:hover {
text-decoration: none;
background: #444;
}
.dark-theme .current {
background: #222;
color: #FFF;
border-color: #000;
box-shadow: 0 1px 0 rgba(255,255,255,0.2), 0 0 1px 1px rgba(0, 0, 0, 0.1) inset;
cursor: default;
}
.dark-theme .ellipse {
background: none;
border: none;
border-radius: 0;
box-shadow: none;
font-weight: bold;
cursor: default;
}
var items =$(".main .para");
console.log(items.length);
console.log(items);
items.slice(5).hide();
$('#pagination').pagination({
items: items.length,
itemsOnPage: 5,
prevText:"«",
nextText: "»",
onPageClick: function (page) {
var from = 5*(page-1);
var end = from+5;
items.hide().slice(from,end).show();
}
});