Exit Intent on Mobile
How Zigpoll detects exit intent on mobile devices
How Mobile Exit Intent Works
Custom Implementation
function myScrollSpeedFunction() {
const delta = my_scroll();
if (delta < -80) {
// Trigger your Zigpoll survey here
window.Zigpoll.open();
}
}
var my_scroll = (() => {
let last_position, new_position, timer, delta, delay = 50;
function clear() {
last_position = null;
delta = 0;
}
clear();
return () => {
new_position = window.scrollY;
if (last_position != null) {
delta = new_position - last_position;
}
last_position = new_position;
clearTimeout(timer);
timer = setTimeout(clear, delay);
return delta;
};
})();
document.addEventListener('scroll', myScrollSpeedFunction);Last updated

