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 pause/resume for the animated element #111

Closed
jongmoon opened this issue Jan 28, 2016 · 1 comment
Closed

Support pause/resume for the animated element #111

jongmoon opened this issue Jan 28, 2016 · 1 comment
Assignees
Milestone

Comments

@jongmoon
Copy link
Contributor

It's migrated from Internal Issue List.

Why we do?

There's some components implemented a pause/resume. But They are not incomplete.

(I've found severals, but currently I can found below one. Need More Search)
For example, https://github.com/tobia/Pause

1. It doesn't support chaining

  • below code can not be pause/resume by this component.
  $el.animate(prop1).animate(prop2);

2. It doesn't support relative positioning(or movement) like below

  $el.animate({"left": "+=100px"});

3. Absolutely, It doesn't support trasform that egjs can do

And other purpose?

We can dig up jQuery more.

Check Point

I think if we overcome below things, we can implement them.

1. Store animation queue(fx.queue) and Restore them.

2. Relative position calculation

  • We must trace the position.
  • General CSS property like "left", "right", ... looks like easy but relative position by transform is not a simple problem.

Relative Position Calculation

Suggestion

When paused, store below value.

Last Time Ratio (r) = time consumed (d) / total time (t)
Relative Position To Move (p) = Destination Value(v) - v * easing(r)

When resumed, restore above value and animate with them.

this.animate({"pos": "+=p"});//psuedo, MUST decompose each by type (like left, top, margin, ...)
@jongmoon jongmoon self-assigned this Jan 28, 2016
@jongmoon jongmoon added this to the 1.1.0 milestone Jan 28, 2016
@mixed mixed removed this from the 1.1.0 milestone Feb 18, 2016
@mixed
Copy link
Member

mixed commented Feb 18, 2016

Pass to next release

jongmoon pushed a commit to jongmoon/egjs that referenced this issue Mar 9, 2016
jongmoon pushed a commit to jongmoon/egjs that referenced this issue Mar 9, 2016
jongmoon pushed a commit to jongmoon/egjs that referenced this issue Mar 9, 2016
@taihoon taihoon added this to the 1.2.0 milestone Mar 24, 2016
@mixed mixed modified the milestone: 1.2.0 Mar 24, 2016
jongmoon added a commit that referenced this issue Mar 25, 2016
feat(pauseResume): pause/resume feature(jQuery plugin)

Ref #111
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

4 participants