Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
provides a great way for you to allow users to search through the text of any mix of elements. Simply provide a text input box and ElementFilter does the rest of the work.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Docs
Source
README.md
package.yml

README.md

ElementFilter

ElementFilter provides a great way for you to allow users to search through the text of any mix of elements. Simply provide a text input box and ElementFilter does the rest of the work.

Screenshot

How to Use

ElementFilter may be initialized at any time (usually at DOMReady). Numerous custom options may be used.

#JS
/* ElementFilter instance */
window.addEvent('domready',function() {
  var myFilter = new ElementFilter('search-term', '#my-list li', {
    trigger: 'keyup',
    cache: true,
    onShow: function(element) {
        element.set('morph',{
            onComplete: function() {
                element.setStyle('background-color','#fff');
            }
        });
        element.morph({'padding-left':30,'background-color':'#a5faa9'});
    },
    onHide: function(element) {
        element.set('morph',{
            onComplete: function() {
                element.setStyle('background-color','#fff');
            }
        });
        element.morph({'padding-left':0,'background-color':'#fac3a5'});
    }
  });
});

For specific usage and options, please read the documentation or visit http://davidwalsh.name/plugin-element-filter

Something went wrong with that request. Please try again.