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

animating list items being hidden/revealed #264

Closed
FND opened this issue Aug 7, 2014 · 3 comments
Closed

animating list items being hidden/revealed #264

FND opened this issue Aug 7, 2014 · 3 comments

Comments

@FND
Copy link

FND commented Aug 7, 2014

After quite some time digging into List.js's source, I seem to have found a way to add animations when list items are removed/added:

http://codepen.io/anon/pen/KAadF

var templater = userList.templater;
templater.clear = jQuery.noop; // relying on `show`/`hide` instead
templater.show = function(item) {
  jQuery(item.elm).slideDown();
};
templater.hide = function(item) {
  jQuery(item.elm).slideUp();
};

However, I'm not sure that's the Right Way™; it feels like a workaround - is there a better way?

(By the way, I was surprised that List.js's default templater erases the list and recreates it from scratch - is there a reason for that?)

@devolkpl
Copy link

I developed animations by adding/removing css classes. The only important thing to do is setting some timeout before items are filtered.

  1. Before filtering: add styled class (scale, opacity whatever you want) so all elements are invisible.
  2. Filter (with timeout for complete animation)
  3. Remove class from all existing items.

@megalofauna
Copy link

michaltowilk,

This is what I've been unsuccessfully trying as well. Would you mind going into a bit more specific detail? Maybe post your relevant code?

@javve
Copy link
Owner

javve commented May 10, 2015

I'll close this now since it's more a of a question than an issue.

@javve javve closed this as completed May 10, 2015
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

4 participants