is it possible to create a redirect only after the page has been scrooled, for example, in the middle and redirects to another page? I tried various solutions and plugins but couldn't find anything that suited me
is it possible to create a redirect only after the page has been scrooled, for example, in the middle and redirects to another page? I tried various solutions and plugins but couldn't find anything that suited me
Share Improve this question asked Mar 1, 2022 at 21:18 Meliodas861Meliodas861 1 1- Also this is not good for user experience or accessibility to randomly redirect a user as their scrolling, it will confuse screen readers. – wpDev Commented Mar 7, 2022 at 15:47
1 Answer
Reset to default 0Try this solution: You can easily do this by using jQuery.
jQuery(document).scroll(function() {
var y = $(this).scrollTop();
if (y > 800) {
window.location.replace("http://stackoverflow.com");
} else {
console.log('test');
}
});