Open ghost opened 8 years ago
my fix was to use classes instead of id's for placing ajax fetched content inside divs.
do you load new items with AJAX (pjax)?
My solution is (add code into ajax success):
$('.grid').append(html).find('[data-remodal-id]').remodal();
This line says that all content will be executed only once, when the page is loaded. So
$(document).find(..)
isn't executed when navigating by ajax (pjax in my case).My temporary solution is to wrap every non-event function inside of
$(document).ready(..)
in$(document).on('click', ...)
, but I think this should be the core.