ElementFilter 1.2

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.



Details

Author
David Walsh
Current version
1.2
GitHub
darkwing/ElementFilter
Downloads
5567
Category
Utilities
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.2.1: *

How to use

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

/* 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


Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus