I have a script that makes a table responsive (footable). This works great for my needs but I use some ajax to bring in some more table rows, but the script doesn't affect these new rows.
I have tried to reinitiate the script after my ajax has completed but it doesn't work.
My question is, can I remove the affecting jquery so that I can reapply it after the data has been loaded?
My jQuery:
jQuery(document).ready(function ($) {
table();
$('#moreevent').click(function(){
var last = $('#the-event tr').length;
$.ajax({
type: "POST",
url: "ajax.php",
data: { levent: last }
}).done(function( data ) {
$('#the-event').append(data);
cardbox();
table();
});
return false;
});
});
function cardbox(){
jQuery('.e-info-more-cont').hide();
jQuery('.e-info-more').mouseover(function(){
jQuery(this).css({"z-index":"1001"});
jQuery(this).nextAll(".e-info-more-cont").show();
}).mouseout(function(){
jQuery(this).nextAll(".e-info-more-cont").hide();
jQuery(this).css({"z-index":""});
});
}
function table(){
jQuery('.footable').footable();
}