InfiniteScroll не работает для всплывающих окон

У меня есть ссылки на моей странице, которые отображают полноэкранное всплывающее окно с этим html:

<div class="movie-popup-container">
     <div class="popup">
          <-- content of popup --!>
     </div>
</div>

Моя бесконечная прокрутка (от Paul Irish) выглядит следующим образом:

$('#activity').infinitescroll({
    behavior: 'local',
    binder: $('.movie-popup-container'),
    bufferPx: 100,
    loading: {
        finishedMsg: "This is the end!",
        img: "/images/loading2.gif?ver=1",
        msgText: "Loading ...",
        speed: "slow",
        selector: "#movie-activity-container #loading-status"
    },
    debug: true,
    navSelector: navSelectorNew,
    // selector for the paged navigation (it will be hidden)
    nextSelector: nextSelectorNew,
    // selector for the NEXT link (to page 2)
    itemSelector: ".movie-activity-feed"
    // selector for all items you'll retrieve
});

Я настроил плагин так, чтобы он работал только для прокрутки всплывающих окон, а не для прокрутки окон. Это работает только для некоторых всплывающих окон, но не для других, и шаблона нет. Он работает для того же всплывающего окна, для которого раньше не работал, и наоборот. По содержанию все всплывающие окна имеют одинаковые данные. Журнал отладки выглядит следующим образом:

//1st popup

XHR finished loading: "http://example.com/GetMain.jsp?productId=6219a937-6d9c-4d42-81b6-85380c306732". jquery.min.js:2
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=0&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=2". jquery.min.js:2
["determinePath", Array[2]]
 plugins.js:51
["Binding", "bind"] plugins.js:51
["math:", 2813, 2728] plugins.js:51
["heading into ajax", "/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=2"] plugins.js:51
Using HTML via .load() method plugins.js:51
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=2". jquery.min.js:2
["contentSelector", div#movie-activity]
 plugins.js:51
["math:", 2613, 2728] plugins.js:51
["heading into ajax", "/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=3"] plugins.js:51
Using HTML via .load() method plugins.js:51
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=3". jquery.min.js:2
["contentSelector", div#movie-activity]
 plugins.js:51
["math:", 1973, 2728] plugins.js:51
["heading into ajax", "/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=4"] plugins.js:51
Using HTML via .load() method plugins.js:51
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=4". jquery.min.js:2
["contentSelector", div#movie-activity]
 plugins.js:51
["math:", 1173, 2728] plugins.js:51
["heading into ajax", "/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=5"] plugins.js:51
Using HTML via .load() method plugins.js:51
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=5". jquery.min.js:2
["Error", "end"] plugins.js:51
["Binding", "unbind"] plugins.js:51
//1st popup closed with successful scrolling

//2nd popup 
XHR finished loading: "http://example.com/GetMain.jsp?productId=6219a937-6d9c-4d42-81b6-85380c306732". jquery.min.js:2
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=0&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=2". jquery.min.js:2
["determinePath", Array[2]]
 plugins.js:51
["Binding", "bind"] plugins.js:51
["math:", 3113, 2728] plugins.js:51
["math:", 2813, 2728] plugins.js:51
["heading into ajax", "/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=2"] plugins.js:51
Using HTML via .load() method plugins.js:51
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=2". jquery.min.js:2
["contentSelector", div#movie-activity]
 plugins.js:51
["math:", 1984, 2728] plugins.js:51
["heading into ajax", "/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=3"] plugins.js:51
Using HTML via .load() method plugins.js:51
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=1&type=all&productId=6219a937-6d9c-4d42-81b6-85380c306732&page=3". jquery.min.js:2
["contentSelector", div#movie-activity]
 plugins.js:51
//2nd popup closed with successful scrolling

//3rd popup
XHR finished loading: "http://example.com/GetMain.jsp?productId=cf352423-0b05-4fa2-9ca8-323842bc96c2". jquery.min.js:2
XHR finished loading: "http://example.com/GetXYZ.jsp?cache=0&type=all&productId=cf352423-0b05-4fa2-9ca8-323842bc96c2&page=2". jquery.min.js:2
["determinePath", Array[2]]
 plugins.js:51
["Binding", "bind"] plugins.js:51
["math:", 3113, 2308] plugins.js:51
["math:", 2913, 2308] plugins.js:51
["math:", 2613, 2308] plugins.js:51
["math:", 2464, 2308]
//3rd popup scrolling failed despite going till bottom. 

Для третьего всплывающего окна в приведенном выше журнале я прокрутил до конца, и он просто продолжал показывать математическую строку в отладке. Кроме того, не могли бы вы сказать мне, что представляет собой строка ["math:", 3113, 2308]?


person soundswaste    schedule 31.10.2013    source источник


Ответы (2)


Поскольку вы не предоставили пример, который можно было бы протестировать, я отвечу на несколько предположений:

  1. Вы используете плагин или самописный скрипт для всплывающих окон
  2. Сценарий всплывающего окна должен быть инициализирован один раз, чтобы ссылки открывали всплывающие окна при событии клика.

Если мои предположения верны, то проблема связана с инициализацией всплывающих окон. Вы должны запустить свой сценарий снова после запуска сценария бесконечной прокрутки. Вы можете сделать это в обратном вызове.

$(elem).infinitescroll(options,[callback for reinitalization of popups]);
person Aniket    schedule 14.11.2013

математика представляет:

this._debug('math:', pixelsFromWindowBottomToBottom, opts.pixelsFromNavToBottom);

// if distance remaining in the scroll (including buffer) is less than the orignal nav to bottom....
return (pixelsFromWindowBottomToBottom - opts.bufferPx < opts.pixelsFromNavToBottom);

см. https://github.com/paulirish/infinite-scroll/blob/master/jquery.infinitescroll.js

2464-40 ‹ 2308 = ложь

который должен вызывать this.retrieve()

// я вижу, что вы установили для bufferPx значение 100, которое все равно должно разрешиться как false

2464-100 ‹ 2308 = ложь

надо бы еще поискать...

person Greg    schedule 13.11.2013