How to Display Lightboxes on Infinite Scroll

Follow these steps to display your lightbox on Infinite Scroll.

If your URL DOES NOT change:

You would need to call our function any time that they want to signal a “new page view”. This will tell our code to re-process itself and display any eligible boxes.

window.DIGIOH_API.LIGHTBOX.onInfiniteScrollPageChanged(url, send_pv_event, update_pv_based_vars, use_master_rules, re_calc_ab_tests);

Since the URL doesn’t change, we would want that to be an empty string (which tells us to just use the current URL). The other parameters are Boolean values (true/false). We recommend the following setup:

window.DIGIOH_API.LIGHTBOX.onInfiniteScrollPageChanged(“”, true, true, false, false);

If your URL DOES change:

Use this setup instead:

var new_url = window.location.href;
window.DIGIOH_API.LIGHTBOX.onPageUrlChanged(new_url, true, true, false, false);



If your Function is being Called before the Digioh Script loads:

You would want to wait to call the function for a second or two.

Or alternatively, implement the following retry policy:

var retryDigiohPageChangeInterval = setInterval(function() {
if (window.DIGIOH_API.LIGHTBOX. isDigiohReady()) {

window.DIGIOH_API.LIGHTBOX.onInfiniteScrollPageChanged(“” , true, true, false, false);

clearInterval( retryDigiohPageChangeInterval) ;
}, 500);