I have a jquery script that generates items dynamically on the scroll. By default, the overlay style for these items is set as visibility: hidden
I decided to change the overlay style on the fly a checkbox, and make them visible:
$(' #switch').click(function() {
if ($(this).prop("checked") == true) {
$('.footer-inner').css({ visibility: 'visible' });
} else if ($(this).prop("checked") == false) {
$('.footer-inner').css('visibility', 'hidden');
}
});
The code trigger well for all the items already created on the page. But if I scroll down, the news items don't have the overlay is not visible.