Please tell me, I used to use the live function or the livequery module to access elements loaded with AJAX.
Need to do something like:
$('img').livequery(function() { $(this).fancybox(); }); How to do this in jQuery 3. *?
You can use on , for example:
$('img').on('click',function() { $(this).fancybox(); }); If you need to reinitialize Fancybox after an AJAX request, simply insert the call after the AJAX request ends (for example)
...... 'success' : function (data) { $('img').fancybox(); } Source: https://ru.stackoverflow.com/questions/623280/
All Articles