chrisbateman / impetus

Agnostic utility for adding momentum to anything. It's like iScroll, except not for scrolling. Supports mouse and touch events.
chrisbateman.github.io/impetus
MIT License
487 stars 70 forks source link

feat: added a new “window” property, so that Impetus can be applied to child iframes #32

Open azaslavsky opened 7 years ago

azaslavsky commented 7 years ago

If I create a child <iframe> on my page, and want to use impetus in that iframe, that is currently not possible. This commit adds support for the optional "window" property, which allows me to supply a different window to bind impetus to (ex: window: myIframe.contentWindw). I also moved the safari bug fix inside of the init() function, so that each window that impetus is used with can have this bugfix applied.