Jquery not run using pagination with listjs

62 Views Asked by At

The event over the follow pagination not run.

When I click over the class "marcar_cliente" this add the class with background

the example in:

http://codepen.io/mattisbmx/pen/xdMVLM

This is the code:

JS:

    $(document).ready(function() {
        $(".marcar_cliente").on("click", _Marcar_Cliente);
    });

var monkeyList = new List('test-list', {
    valueNames: ['name'],
    page: 3,
    pagination: true
});

function _Marcar_Cliente(){
    var li = $(this);
    if(li.hasClass("cliente-marcado")){
        li.removeClass('cliente-marcado');
    }else{
        li.addClass('cliente-marcado');
    }
}
1

There are 1 best solutions below

0
On

JS:

$(".marcar_cliente").on("click", function(){
            $(this).toggleClass( 'cliente_marcado', '');
            console.log("fff");
        })

var monkeyList = new List('test-list', {
  valueNames: ['name'],
  page: 6,
  pagination: true
});