options
//Default options
options = {
animationDuration: 0.5,
callbacks: {
onFilteringStart: function() { },
onFilteringEnd: function() { },
onShufflingStart: function() { },
onShufflingEnd: function() { },
onSortingStart: function() { },
onSortingEnd: function() { }
},
controlsSelector: '',
delay: 0,
delayMode: 'progressive',
easing: 'ease-out',
filter: 'all',
filterOutCss: {
opacity: 0,
transform: 'scale(0.5)'
},
filterInCss: {
opacity: 0,
transform: 'scale(1)'
},
layout: 'sameSize',
multifilterLogicalOperator: 'or',
selector: '.filtr-container',
setupControls: true
}
The properties of Filterizr's options object are:
-
animationDuration (typeof: Number / Default: 0.5)
The duration of CSS3 transitions, taking place for your effects.
-
callbacks (typeof: Object)
Used as the namespace for your callbacks.
-
onFilteringStart (typeof: Function / Default: Empty function)
Called when you fire the filter method.
-
onFilteringEnd (typeof: Function / Default: Empty function)
Called when the filtering animation is complete.
-
-
controlsSelector (typeof: String / Default: '')
In case there is the need to have more than one Filterizr instance on the same page then you need to set up different controls for them. This is where this option comes in handy. When instantiating your Filterizr you will need to set the following options:
{ controlsSelector: '.filtr-controls', setupControls: false }
Then you will have to set the same class on all of your Filterizr controls, i.e. in this case.filtr-controls
.
The optionsetupControls: false
will prevent the default controls from being set up and by defining thecontrolsSelector
you target a specific set of controls for this Filterizr instance. -
delay (typeof: Number / Default: 0)
Measured in milliseconds and used to set the value of the transition-delay property of every item. The value of the transition-delay is incremented progressively by the value of delay for every item to create a more progressive version of your effect.
-
delayMode (typeof: String / Default: 'progressive')
Determines how delay is applied to the transition between items. The two possible values are progressive and alternate. The value of delayMode makes no difference if delay is 0.
-
easing (typeof: String / Default: 'ease-out')
The easing algorithm used for CSS3 transitions. Look up the CSS3 transition-timing-function property for possible values.
-
filter (typeof: String or Number / Default: 'all')
The default value can be used for an unfiltered gallery. To initialize a filtered gallery, set this property to your category of choice before instantiating Filterizr.
-
filterOutCss (typeof: Object / Default: { opacity: 0, transform: 'scale(0,0)' })
An object with CSS properties, written the same way you would write it for jQuery's
.css()
function. This the transition that plays when your items are being filtered out. -
filterInCss (typeof: Object / Default: { opacity: 1, transform: 'scale(1,1)' })
An object with CSS properties, written the same way you would write it for jQuery's
.css()
function. This the transition that plays when your items are being filtered in. -
layout (typeof: String / Default: 'sameSize')
By default sets the layout for items with same width and height. Other possible values are:
'packed'
for a layout of items of varying width and height,'sameWidth'
for a layout of items with the same width but varying height.'sameHeight'
for a layout of items with the same height but varying width.'horizontal'
for a layout of items laid out horizontally.'vertical'
for a layout of items laid out vertically. To see a demo of each and every layout, check the Tutorials section. -
multifilterLogicalOperator (typeof: String / Default: 'or')
This option defines the logic in which multifiltering will be applied in case it's enabled. If set to
'or'
then it will render all items that belong to one of the active categories e.g. 3 or 4. If set to'and'
then it will render all items that belong to both categories i.e. 3 and 4. -
selector (typeof: String / Default: '.filtr-container')
The selector of the container used for your gallery.
-
setupControls (typeof: Boolean / Default: true)
If set to true then Filterizr will try to detect and set up filtering, shuffling and sorting controls. In case you have multiple Filterizrs in your view, you might decide to set this to false and set up your own controls, using the public API, so as to avoid interference the controls of your Filterizrs.
Filterizr is set up to work out of the box. If you wish to override the default options you can either:
- Pass an options object to the jQuery constructor:
var filterizd = $('.filtr-container').filterizr({
//your options here
}) - Override the options using the setOptions method on your Filterizr object:
filterizd.filterizr('setOptions', {
//your options here
})