Capture scroll event on div

后端 未结 3 1250
耶瑟儿~
耶瑟儿~ 2021-01-19 11:55

I\'m trying to capture the scroll event within a Backbone.Marionette.CompositeView, but without success.

As an exercise, I\'m rewriting http://www.atinux.fr/backbone

3条回答
  •  醉梦人生
    2021-01-19 12:34

    Backbone attaches to the top el element to look for all events. Some DOM events are not bubbled to parent elements and this includes scroll. The click event worked because it does bubble.

    Ref: http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#event-type-scroll

提交回复
热议问题