<div id="pag"> <!-- en este div se esta manipulando el dom para lo de la paginacion --> </div>
$(document).ready(function(){
var pag = $('input[name=paginas]').val();
$("#pag").paginate({
count : pag,
start : 1,
display : 12,
border : false,
text_color : 'black',
background_color : 'none',
text_hover_color : '#2573AF',
background_hover_color : 'none',
images : true,
mouse : 'press',
onChange: function(page) {
$.ajax({
type: 'POST',
url: 'http://localhost/facturas/index.php/Factura_controller/paginar',
data: 'pagina='+page,
success: function(resp){
$('#registros').html(resp);
}
});
}
});