Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a class="filter_by_link" href="#" data-value="2" data-target='#country_filter'>Country NL</a>
- <input type="hidden" id="country_filter"/>
- <a class="filter_by_link" href="#" data-value="10-20" data-target='#link_filter'>Price: 10 - 20</a>
- <a class="filter_by_link" href="#" data-value="20-30" data-target='#link_filter'>Price: 20 - 30</a>
- <input type="hidden" id="link_filter"/>
- $('.filter_by_link, #clear_link_filter').click(function(e){
- e.preventDefault();
- $($(this).data('target')).val($(this).data('value'));
- fJS.filter();
- });
- // the filter settings
- // selector, type, event, criteria, json attribute
- // .type range for numbers including the specials below-xy and xy-above
- // example <input checked="checked" value="20-above" type="checkbox">
- var settings = {
- filter_criteria: {
- link_filter: ['#link_filter .EVENT.change .SELECT.:input .TYPE.range', 'age'],
- age: ['#country_filter .EVENT.change .SELECT.:input ', 'country_id']
- },
- and_filter_on: true //If any filter selection is zero then select none. For 'OR' filter set 'false'
- };
- // Trigger the filtering (json src, target html, the template, filter settings)
- var fJS = new FilterJS(people, "#something", view, settings);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement