Pass mousewheel event through fixed content

后端 未结 5 2053
有刺的猬
有刺的猬 2020-12-31 04:42

The best way to understand this is to look at this fiddle.

Notice how mouse wheel over the fixed content in the red box does nothing. I would like the

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 05:21

    A much, MUCH simpler, but much less widely supported, answer is the following:

    #fixed{ pointer-events:none; }
    

    jsFiddle
    Doesn't work in IE at all though unfortunately! But you could use modernizr or somesuch to detect whether it was supported and use the jQuery as a stop-gap where it isn't.

    Courtesy of Mr. Dominic Stubbs

提交回复
热议问题