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

Feature request: animate in only #5

Open
evanwarner opened this issue Aug 20, 2018 · 2 comments
Open

Feature request: animate in only #5

evanwarner opened this issue Aug 20, 2018 · 2 comments

Comments

@evanwarner
Copy link

Using Delighters for the first time and loving the simplicity of just the class toggle that lets me control everything else. I think a good addition would be a config option to make the class changes be one-time actions, and not have the classes removed from elements when scrolling back up the page. That way once an element animates in, it's forever there.

@kush1960
Copy link

I've been wondering the same thing. It can become a bit jarring to have things moving out as well as in.

@crazy4groovy
Copy link

crazy4groovy commented Jan 12, 2019

Shouldn't be too hard to add, with options.canRewind:
https://github.com/Q42/delighters/blob/master/src/delighters.js#L77

			if (factorStart < del.start && !del.started) {
				del.started = true;
				del.el.classList.add(options.classNames[1])
			}
			else if (factorStart > del.start && del.started && options.canRewind) {
				del.started = false;
				del.el.classList.remove(options.classNames[1])
			}
			if (factorEnd < del.end && !del.ended) {
				del.ended = true;
				del.el.classList.add(options.classNames[2])
			}
			else if (factorEnd > del.end && del.ended && options.canRewind) {
				del.ended = false;
				del.el.classList.remove(options.classNames[2])
			}

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

No branches or pull requests

3 participants