Jump to content
Search Community

How to switch normalizeScroll to false on mobile devices

nicolaseielll test
Moderator Tag

Recommended Posts

I have smooth scroll configured to my project but the scroll gets laggy on mobile devices if normalizeScroll is set to true so I was wondering if there's a way to switch it to false if user is on a mobile device.

 

I tried this and it changes the boolean but the normalizeScroll wont switch conditionally.

if(window.innerWidth < 960) {
  this.normalizeScroll = false
} else {
  this.normalizeScroll = true
}
this.$scrollSmoother.refresh()

Here's a codesandbox with the same setup I have in my project: https://codesandbox.io/s/gifted-sea-6rybt5?file=/layouts/default.vue

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...