Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/khaliqgant/simple-list-filter

Super simple js to to filter items using a dropdown menu
https://github.com/khaliqgant/simple-list-filter

Last synced: 4 days ago
JSON representation

Super simple js to to filter items using a dropdown menu

Awesome Lists containing this project

README

        

Simple List Filter
=====

Some super simple JS to to filter items using a dropdown menu. Includes a jQuery version and a pure Javascript version.

Install with bower ````bower install simple-list-filter ````

Requirements
------
Simple List Filter was made to be as modifiable and as easy to use as possible:
* The dropdown filters must be enclosed in an element with a class of "filters"
* The filter category should be the dropdown text ie: ````Cat````
* The ul enclosing the filters should be preceded with a "js" and end with "filter", ex: "js-desiredFilter-filter"
* The filter should be the link text within an li ie: ````

  • Playful
  • ````

    ```


    ```

    * The items to be filtered should be within a ul with an id of "kjg-simple" (kjg being my initials #vain)
    * The li item should have a class of js-filter-item and data attributes should specify the filter category

    ```






    ```

    Warranty/License
    --------
    There's no warranty of any kind. If you find a bug, please report it or submit a pull request with a fix. It's provided completely as-is; if something breaks, you lose data, or something else bad happens, the author(s) and owner(s) of this add-on are in no way responsible.

    Why did you make this?
    --------
    Well, there are several plugins to filter items but none seemed to be modifiable and modular enough for what I need it for. I left the styling and markup as simplistic as possible so you can simply copy the JS code into your project and make it look however you want.
    There are a plethora of (more robust) plugins out there to filter items:
    * List.js (http://listjs.com/)
    * Quicksand (http://razorjack.net/quicksand/)
    * Filtrify (http://luis-almeida.github.io/filtrify/)

    I also wanted to write some pure javascript so figured this would be a good exercise. The pure javscript version may or may not work in IE, I haven't tested it to be honest.