overflow-x: hidden is breaking jquery scroll event

后端 未结 5 397
灰色年华
灰色年华 2021-01-07 23:14

I am having an issue where setting overflow-x: hidden on the html and body elements is preventing the jquery scroll event from firing.

CSS:

html, bod         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 23:48

    Set body {height: 100%;} in css. It would work then. You may want to apply overflow property on a div than to whole body and then change JS code accordingly. Setting a overflow property on body takes away its scrolling ability. Another solution can be using Jquery wheel event as described in this post- (https://stackoverflow.com/a/8378946/5348972).

提交回复
热议问题