problème de pop-up et infinity scroll

Par Motel, il y a 7 ans


Bonjour,

j'ai un problème avec mon script infinity scroll quand je fais défiler vers le bas et que je clique sur une image pour faire apparaître le contenu pop-up la pop-up ne se lance pas et j'ai aucune erreur dans la console mais les images précédentes quand je clique dessus la pop-up fonctionne bien :/

infinity scroll.js

jQuery(document).ready(function() { var offset = 18; // on initialise ajaxready à true au premier chargement de la fonction $(window).data('ajaxready', true); $('.list-scroll').append('<div id="test"><p>dfdfdfdfd</p></div>'); var deviceAgent = navigator.userAgent.toLowerCase(); var agentID = deviceAgent.match(/(iphone|ipod|ipad)/); $(window).scroll(function() { // On teste si ajaxready vaut false, auquel cas on stoppe la fonction if ($(window).data('ajaxready') == false) return; if(($(window).scrollTop() + $(window).height()) == $(document).height() || agentID && ($(window).scrollTop() + $(window).height()) + 150 > $(document).height()) { // lorsqu'on commence un traitement, on met ajaxready à false $(window).data('ajaxready', false); $('.list-scroll #test').fadeIn(400); $.get('/feed/itemListerProductScroll/' + offset + '/', function(data){ if (data != null) { $('.list-scroll #test').before(data); $('.list-scroll .hidden').fadeIn(400); offset+= 18; // une fois tous les traitements effectués, // on remet ajaxready à false // afin de pouvoir rappeler la fonction $(window).data('ajaxready', true); } $('.list-scroll #test').fadeOut(400); if(data == false) { console.log(offset) } }); } }); });

popup.js

$(function() { // // Open shot in a modal // $('[data-toggle="modal"]').on('click', function(e) { e.preventDefault(); $('body').addClass('modal-open'); // Put a spinner inside the modal and open it $('#model-index .modal-content').html('<div id="preloader"> <div id="loader"></div> </div>'); $('#model-index').modal(); // Load data from server and initialize the gallery. // You can add a data-id="XXX" to each .shot var shotId = $(this).data('id'); var path = $(this).data('path'); $('#model-index .modal-content').load(path + '/' + shotId, function() { select(); }); }); });

1 réponse

Motel, il y a 7 ans

Quelqu'un a une idée a mon probléme :/