views:

29

answers:

0

Here is my code, I don't know what is wrong. It is working but something is wrong in the cloned pagination doesn't following the #Pagination. When I clicked page 2 of #Pagination the #bottom_pagination_placeholder is not following. Please help

<script type="text/javascript" src="js/jquery.js"></script>
  <script type="text/javascript" src="js/pagination.js"></script>
  <script type="text/javascript">
  var pagination_options = {
  num_edge_entries: 2,
  num_display_entries: 5,
  callback: pageselectCallback,
  items_per_page:20
  }
  function pageselectCallback(page_index, jq){
  var items_per_page = pagination_options.items_per_page;
  var offset = page_index * items_per_page;
  var new_content = $('#hiddenResult tr.result').slice(offset, offset + items_per_page).clone();
  $('#Searchresult').empty().append(new_content);
  return false;
  }
  function initPagination() {
  var num_entries = $('tr.result').length;
  $("#Pagination").pagination(num_entries, pagination_options);
  }
  $(document).ready(function(){ 
  initPagination();
  $("#Pagination").clone(true).appendTo("#bottom_pagination_placeholder");
  });
  </script>
<div id="Pagination" class="pagination"></div>
  <table width="100%" class="tbl_prod_list" align="center">
  <tbody id="Searchresult"></tbody>
  <tbody id="hiddenResult" style="display:none;" >
  // result
  <tr class="result">
  <td>Result</td>
  </tr>
  // end result
  </tbody>
  </table>
  <div id="bottom_pagination_placeholder" class="pagination"></div>

Here is the original pagination: http://d-scribe.de/webtools/jquery-pagination/demo/demo_options.htm