Jump to content
GreenSock

Sukru

Modalbox Mobile Device Scroll

Recommended Posts

Hello, I was using parallax in my project but I am using code to turn this feature off for mobile devices. However, when I did this, the parallax visuals became normal as I wanted. But I can't pause body scroll with scrollsmoother in this way. For example, when I open the menu, the page scroll works. I have such a problem, how can I solve it?

I share my project link with you;

 

Example
https://yeni.dybank.com.tr/
If you try this link on mobile, you will understand more easily what I mean.

Thank you so much.

 

 

See the Pen MWGVNjK by sukruemanet (@sukruemanet) on CodePen

Link to comment
Share on other sites

Hi @Sukru,

 

It seems that you found the paused method and that is working as expected, right?

 

Please let us know.

 

Happy Tweening!

Link to comment
Share on other sites

5 hours ago, Rodrigo said:

Hi @Sukru,

 

It seems that you found the paused method and that is working as expected, right?

 

Please let us know.

 

Happy Tweening!

 

Yes, but because I want the parallax effect to work only on desktop, I used the matchMedia feature, but on mobile, gsap is completely disabled and scroll is not locked. Can I just use the matchMedia property for parallax?

Link to comment
Share on other sites

3 hours ago, Sukru said:

Can I just use the matchMedia property for parallax?

I'm not sure what you mean, but it certainly seems like you could do that. gsap.matchMedia() lets you have certain code that only runs in certain viewport sizes, for example. So if you want parallax in only certain scenarios, sure, put it in there. 👍

Link to comment
Share on other sites

10 hours ago, GreenSock said:

I'm not sure what you mean, but it certainly seems like you could do that. gsap.matchMedia() lets you have certain code that only runs in certain viewport sizes, for example. So if you want parallax in only certain scenarios, sure, put it in there. 👍

 

Actually, what I want to do is very simple, I want the parallax effect to look normal on mobile devices, I want the parallax effect to be absent.

Link to comment
Share on other sites

Hi @Sukru,

 

I'm not seeing a parallax effect on mobile and smaller screens, at least in the codepen example. The MatchMedia code seems to be working exactly the way is supposed.

 

If you are having other issues please create a new minimal demo or update the current one so we can get a better idea of what could be the problem.

 

Happy Tweening!

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.
×