title: How to add pagination in photo gallery?
body: <p>My HTML Code is like this :</p>
  
  <pre><code>&lt;!-- Button trigger modal --&gt;
  &lt;button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"&gt;Launch demo modal&lt;/button&gt;
  &lt;!-- Modal --&gt;
  &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                   &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt;
  
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
  
  
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!-- /.modal-content --&gt;
      &lt;/div&gt;
      &lt;!-- /.modal-dialog --&gt;
  &lt;/div&gt;
  &lt;!-- /.modal --&gt;
  </code></pre>
  
  <p>My Javascript Code is like this : </p>
  
  <pre><code>htmlData = '';
      htmlData = 'Photos&lt;a href="#" id="hotel_photo" data-hotel-code="nases"&gt;(Click to View)&lt;/a&gt;&lt;br&gt;&lt;br&gt;';
      htmlData += '&lt;div class="imageHotel"&gt;&lt;/div&gt;';
  
      $('#myModal').find('.modal-body').html(htmlData);
  
      $(".imageHotel").hide();
      $(document).on("click", "#hotel_photo", function(event){
          $(".imageHotel").toggle();
          event.preventDefault();
          htmlData += '&lt;div id="gallery_hotel"&gt;';
  
              htmlData = '&lt;img id="largeImage" src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_01_large.jpg" /&gt;';
  
          htmlData += '&lt;/div&gt;';
  
  
          htmlData += '&lt;div id="thumbs_hotel"&gt;';
  
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_01_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_02_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_03_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_04_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_05_thumb.jpg" /&gt;';
               htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_01_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_02_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_03_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_04_thumb.jpg" /&gt;';
              htmlData += '&lt;img src="http://www.workshop.rs/demo/gallery-in-4-lines/images/image_05_thumb.jpg" /&gt;';
  
          htmlData += '&lt;/div&gt;';
  
          $('.imageHotel').html(htmlData);
  
          // bind the click event
          $('#thumbs_hotel').off().on('click', 'img', function () {
            console.log($(this).attr('src'));
            $('#largeImage').attr('src',$(this).attr('src').replace('thumb','large'));
          });
  
      });
  </code></pre>
  
  <p>Demo is like this : <a href="https://jsfiddle.net/oscar11/10td0yww/5/" rel="nofollow">https://jsfiddle.net/oscar11/10td0yww/5/</a></p>
  
  <p>I want add pagination in my photo gallery. So the images shown only 5 pictures per page. for example, there are 10 pictures, then there will be 2 page</p>
  
  <p>Any solution to solve my problem?</p>
  
  <p>Thank you very much</p>