I executing a function like this,
The callback of the pagination plugin here which I assume you are using is defined internally as
opts.callback(current_page, containers);
This is different to the signature of your callback so no it will not work the same.