How can we help?

How do you get the lightbox to display on Infinite Scroll?

How do you get the lightbox to display on Infinite Scroll?

This is 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.PRIMER_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). I recommend the following setup:

window.PRIMER_API.LIGHTBOX.onInfiniteScrollPageChanged("", true, true, false, false);

This is if your URL DOES change:

Same as above, just use instead:


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

 

FAQ:

If your Function is being Called before the Primer Webforms Script loads:

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

Or alternatively, implement the following retry policy:

var retryPrimerPageChangeInterval = setInterval(function() {
if (window.PRIMER_API.LIGHTBOX.isPrimerReady()) {
window.PRIMER_API.LIGHTBOX.onInfiniteScrollPageChanged(""  , true, true, false, false);
clearInterval( retryPrimerPageChangeInterval) ;
}
}, 500);

Comments

0 comments

Please sign in to leave a comment.