Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-window scrolling #4

Open
tdreyno opened this issue May 17, 2015 · 3 comments
Open

Support non-window scrolling #4

tdreyno opened this issue May 17, 2015 · 3 comments

Comments

@tdreyno
Copy link

tdreyno commented May 17, 2015

Sometimes you need a fake scroll container instead of window, for things like basement menus or certain page transitions. This requires tracking an element's scroll events, rather than window.

Thankfully, the project I'm working on has down away with its scrolljacked container. But I thought I'd raise this for down the road.

Normally, I'd use my own morlock.js for this, but I'm tired of maintaining it so I put this TODO on your plate instead :)

The important parts are: https://github.com/tdreyno/morlock.js/blob/master/streams/scroll-stream.js#L15
And: https://github.com/tdreyno/morlock.js/blob/master/core/dom.js#L42-L52

Thanks for this simple project 🍻

@samccone
Copy link
Owner

Yeah so scoped element scrolling, was more or less was waiting for a usecase to implement this. Simple enough, the question becomes what is an elegant API.

My gut tells me it should be part of the track API.

Scrollin.track(elm, {handler: () => {},  parent: elm2})

This idea of a scoped tracked element adds some significant complexity (but this project has 0 complexity so far so I am not worried) to this code base, since under the hood I am taking care of untracking and whatnot already, but I think It could turn out quite nice.

How does this sound ^^

@tdreyno
Copy link
Author

tdreyno commented May 17, 2015

That API seems reasonable to me.

@samccone
Copy link
Owner

reasonable apis since 1989™

not to be confused with typescript 1989

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants