Static div’s for pagination

I have a static div’s and I want to create a pagination for this using PHP or JS. Let’s say I have 25 div’s and I want only to display 5 div’s per page. How to do this?

Here’s the format of the html div

<div class="newsbox">
 <img src="#" class="news-img"/>
 <div class="newsmargin">
 <br />
 <h3 class="news-h3">Title</h3>
 <span style="color: gray; font-size: 14px;">28.9.2015</span>
 <p class="newslineheight">Content</p>
<a class="buttonv1" href="#" target="_blank" style="padding: 10px 15px 10px 15px; line-height: 60px;">Read more</a></div>
</div>
<br />

<div class="newsbox">
 <img src="#" class="news-img"/>
 <div class="newsmargin">
 <br />
 <h3 class="news-h3">Title</h3>
 <span style="color: gray; font-size: 14px;">28.9.2015</span>
 <p class="newslineheight">Content</p>
 <a class="buttonv1" href="#" target="_blank" style="padding: 10px 15px 10px 15px; line-height: 60px;">Read more</a></div>
</div>

Related posts

1 comment

  1. Try with java script:

    Demo :http://jsfiddle.net/fSmEL/167/

        <div class="pagnation">
        <div class="newsbox">div1</div>
         <div class="newsbox">div2</div>
        <div class="newsbox">div3</div>
          <div class="newsbox">div4</div>
         <div class="newsbox">div5</div>
         <div class="newsbox">div6</div>
         <div class="newsbox">div7</div>
        <div class="newsbox">div8</div>
        <div class="newsbox">div9</div>
        <div class="newsbox">div10</div>
        <div class="newsbox">div11</div>
        <div class="newsbox">div12</div>
         <div class="newsbox">div13</div>
         <div class="newsbox">div15</div>
        <div class="newsbox">div15</div>
         </div>
    

Comments are closed.