I am having trouble to initialize twbs-pagination jQuery plugin. In document.ready section it works fine but if i need to reset or re-initialize plugin variable in a function (after document loaded) or button click event it gives not a function error. Here is my code
This works fine
jQuery(document).ready(function ($) {
$('#paging-cont').twbsPagination({
visiblePages: 7,
totalPages: 12,
});
});
problem is when i am trying to initialize plugin after document.ready
function ShowPagger(totalRec) {
$('#paging-cont').twbsPagination({
visiblePages: 7,
totalPages: totalRec,
});
}
this give error of not a function