Skip to content

Sort by selected dynamic category #901

@ASTN1

Description

@ASTN1

Hi,

firstly I would like to thank you for your work. Isotope is awesome!
Then I hope you'll be able to help me. I'm currently trying to build a sort-able portfolio using Isotope and hit a brickwall because of 2 matters:

  • My buttons set is a list of Wordpress categories, so it's dynamic (categories can be added or removed at any time). It means I cannot define sort tags as recommanded, e.g.
getSortData: {
  green : function ( $elem ) {
    return $elem.data('green');
  },
  red : function ( $elem ) {
    return $elem.data('red');
  },
  blue : function ( $elem ) {
    return $elem.data('blue');
  }
}

I'd rather need a getSortData function which is dynamic, but don't have any idea of how to write it... e.g.

getSortData: {
  x : function ( $elem ) {
    return $elem.data(x);
  }
}
  • Then I'd like the elements which aren't matching the selected category to be faded down.
    Can figure how to do it as well... e.g.
    faded down elements

Thank you very much for your help!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions