Hello,
I would like to know what would be the best way to reinitialize script after an AJAX call. I have post items, each in
container with data-color attribute. I use jquery.inview to change body background color:
$('article').on('inview', function(event, isInView) {
if (isInView) {
var spalva = $(this).attr('data-color');
$('body').css('background-color', spalva);
}
});
However, after and AJAX call this script only works with posts displayed on page load. Therefore I need to reinitialize jquery.inview after the call. I would be very grateful if someone could help me what would be the best way to do it.
Hello,
I would like to know what would be the best way to reinitialize script after an AJAX call. I have post items, each in
container with data-color attribute. I use jquery.inview to change body background color:However, after and AJAX call this script only works with posts displayed on page load. Therefore I need to reinitialize jquery.inview after the call. I would be very grateful if someone could help me what would be the best way to do it.