Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get the initial values and activate filter
- $('.filter-selector').each(function() {
- var $this = $(this);
- $this.data('oldValue', $this.val());
- if ($this.val() == '') {
- return true;
- }
- console.log('ELEMENT IS: '+$this.attr('id'));
- var elemId = $this.attr('id').slice(0, -10);
- var elem = $('#'+elemId+'_content');
- $this.trigger('wolfSwitchFilterIn', [$this.val(), elem]);
- });
- $('.filter-selector').change(function(){
- var $this = $(this);
- var newFilter = $this.val();
- var oldFilter = $this.data('oldValue');
- $this.data('oldValue', newFilter);
- var elemId = $this.attr('id').slice(0, -10);
- var elem = $('#'+elemId+'_content');
- $(this).trigger('wolfSwitchFilterOut', [oldFilter, elem]);
- $(this).trigger('wolfSwitchFilterIn', [newFilter, elem]);
- });
Add Comment
Please, Sign In to add comment