Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

AndyBullet
AndyBullet

Posted on

     

I need an information about the scrollability

Hi guys!
I need an information. Is there a way to make the window unscrollable by touch on touch screen devices? I would like to make it scrollable only from PC.

Top comments(3)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
tchaflich profile image
Thomas C. Haflich
I'm doing my best
  • Location
    Northeast USA
  • Education
    B.S. Chemical Engineering
  • Work
    Software Developer
  • Joined

Is there a particular reason you would like to do this? It's not impossible, but it's finicky and prone to bugs, so it might be easier to just rework your design.

Youcould try disabling the relevant "touch*" events, (seeEvent.preventDefault), but that might have some unintended consequences. Many tablet / convertible-style devices (like the Surface) implement these events. Plus, iOS touch-scrolling events are always a pain to work with, since Apple really does not want you messing with page scrolling.

CollapseExpand
 
andy profile image
Andy Zhao (he/him)
uh oh where'd my bio go!
  • Education
    Actualize Coding Bootcamp
  • Joined

Hmm you could make your page's height in mobile view to something likeheight: 100%? I would use media queries to adjust based on mobile/laptop and desktop views.

CollapseExpand
 
andybullet profile image
AndyBullet
  • Joined

I don't want to remove the scrollability, I want to make it work, but only from computer.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Joined

More fromAndyBullet

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp