OiNutter / guggenheim.js

Framework agnostic gallery plugin with flashy filtering and re-ordering.
https://oinutter.co.uk/guggenheim.js
MIT License
92 stars 16 forks source link

Example of filters using class and classes #1

Open macsupport opened 11 years ago

macsupport commented 11 years ago

Any chance of a demo showing filtering by class and/or classes in addition to your filter function demo?

Mike

OiNutter commented 11 years ago

Hey, unless I'm misunderstanding what you want, the filter function on the examples page is actually filtering by classes. All the function is doing is collating which classes we want to filter by from the inputs and passing them to guggenheim, which then filters by them.

macsupport commented 11 years ago

Sorry I was not clear. I was a bit confused about how to set up the filtering in a way other than using checkboxes or radio buttons. I figured out how to use jQuery select2 and classes to filter items.

macsupport commented 10 years ago

Is there an way to set up a filterFunction to use a input field to search for text used in a guggenheim-item to filter rather than using classes or checkboxes, etc. ?

OiNutter commented 10 years ago

You should be able to pass your own function to filter which will have each element passed to it in turn and use that to inspect the element. Bear in mind it will be the basic DOM element that gets passed so if you're using jQuery or something similar you'll need to convert the element to use jQuery methods on it.

As for hooking into the input field you should just be able to hook into the change event and have your event handler call the filter function and have your filter function grab the value from the input.

If you're still having problems let me know. I haven't actually tested that this will work, it's entirely based of theory and what the code's supposed to do :)