Giter Site home page Giter Site logo

ling-gallery-filter's Introduction

LingGalleryFilter

2019-06-21

A simple jquery plugin to filter items based on their categories.

Demo: https://lingtalfi.com/ling-gallery-filter

screenshot of ling-gallery-filter

How to

First create a div (or any html element) containing your items, and each item has a data-category attribute like this:

<div id="my-items">
    <div class="item" data-category="cat1">item one</div>
    <div class="item" data-category="cat1">item two</div>
    <div class="item" data-category="cat2">item three</div>
</div>

Then create another div (or any html element) containing your tags, and each tag has a data-tag attribute (corresponding to an item category), like this:

<div id="my-tags">
    <a data-tag="all" href="#">All</a>
    <a data-tag="cat1" href="#">Category one</a>
    <a data-tag="cat2" href="#">Category two</a>
</div>

Notice the "all" tag, it has a special meaning (it will display all items).

Now, just import the js file (the ling-gallery-filter.js file) after jquery, and use this js snippet:

$(document).ready(function () {
   $('#my-items').lingGalleryFilter({
            tagContainer: $('#my-tags'),
        });        
});

That's it.

History Log

  • 1.0.0 -- 2019-06-21

    • initial commit

ling-gallery-filter's People

Contributors

lingtalfi avatar

Stargazers

 avatar  avatar Oliver Hulisz avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

munkhuumn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.