1

I want to create a website with the loop scrolling functionality of Unfold's website.

The website loops back to the top once you scroll all the way down to the bottom but it doesn't just jump to the top, it does it seamlessly where you don't even know your at the top again. It also allows the user to scroll up and it does the same thing.

I know this question has been asked and "answered" here but it really wasn't exactly what I was looking for. The previous post's answers are decent but their solutions don't truly emulate unfolds seamless loop scrolling.

I'm looking for a solution that can scroll both ways and transitions smoothly between the end and top and vise versa.

Any ideas?

Community
  • 1
  • 1
Adam Ogden
  • 75
  • 1
  • 8

1 Answers1

0

Well try using this code

if (document.documentElement.clientHeight + $(window).scrollTop() >= $(document).height()) {
    $(document).scrollTop(0)
} else if ($(window).scrollTop() < 1) {
    $(document).scrollTop($(document).height())
}
Mike Ross
  • 2,942
  • 5
  • 49
  • 101