Giter VIP home page Giter VIP logo

filterizr's Introduction

Filterizr logo
Build Status NPM version NPM monthly downloads license badge

Description

Filterizr is a JavaScript library that sorts, shuffles, searches and applies stunning filters over responsive galleries using CSS3 transitions. Write your very own, custom effects in CSS and watch your gallery come to life!

It can also be used as a jQuery plugin.

Install

You can install Filterizr by downloading the minified version on its website/repo or through npm/yarn:

npm install filterizr

or

yarn add filterizr

Three files can be found in the ./dist/ directory:

  • filterizr.min.js is the pure Filterizr JavaScript library that can be used using CommonJS (or ES6) imports, it is the main entry point when installing via npm.
  • vanilla.filterizr.min.js is a distribution of Filterizr which can be used directly in a <script> tag, as it exposes the Filterizr library as a global.
  • jquery.filterizr.min.js is a distribution of Filterizr as a jQuery plugin. It detects and extends the global jQuery object and also exposes the vanilla Filterizr library as a global.

Documentation & Tutorials

Basic usage

If you are building a simple static website and would like to use Filterizr via <script> tag make sure to download /dist/vanilla.filterizr.min.js and load it.

If you would like to use the jQuery variation then include /dist/jquery.filterizr.min.js in a <script> tag. Make sure to import it after jQuery itself.

If you are importing Filterizr from /node_modules, Filterizr's default export provide you with the vanilla JavaScript library:

import Filterizr from 'filterizr'

If you are using jQuery in that same project, also installed via npm and you would like to use Filterizr as a jQuery plugin then you can call the static method Filterizr.installAsJQueryPlugin, passing in the jQuery object as follows:

import $ from 'jquery';
import Filterizr from 'filterizr';

// This will extend the $.fn prototype with Filterizr
Filterizr.installAsJQueryPlugin($);

$('.filter-container').filterizr('filter', 5); // or any other Filterizr API call

Tutorials & Docs

You can find Filterizr's documentation as well as a series of tutorials on how to install and operate Filterizr on the Filterizr website. Here is a list of contents:

Contents:

Why Filterizr?

  • Thoroughly documented and easy to use.
  • Performs great on mobile.
  • Written in TypeScript.
  • Has zero dependencies.

Contributing

If you would like to contribute to Filterizr, please make sure to follow the steps described:

  • Create a fork from master branch
  • Add your feature or bug fix
  • If you're implementing a method, add tests
  • Run the tests and ESLint to make sure everything is ok
  • Make your PR and set the base branch to develop

Browser support

IE11 and all modern browsers.

Donate

Did you enjoy Filterizr? Filterizr is and will always be 100% free, if you would like to show your support feel free to donate:

License

Filterizr is licensed under the MIT License. Enjoy!

filterizr's People

Contributors

bryant1410 avatar dependabot[bot] avatar dgandini avatar giotiskl avatar jariz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

filterizr's Issues

This happens on pages I do not use filterizr - $(...).filterizr is not a function

Hi,
I just started to play around with filterizr and I am having a issue here and I am not sure why...

On the page where I needed filterizr I do not get any error, but on other pages where I didn't even add the filterizr script tag I get the same error.

Uncaught TypeError: $(...).filterizr is not a function
    at HTMLDocument.<anonymous> (app.js:11)
    at fire (jquery.js:3187)
    at Object.fireWith [as resolveWith] (jquery.js:3317)
    at Function.ready (jquery.js:3536)
    at HTMLDocument.completed (jquery.js:3552)

and my short app.js code looks like

$(document).foundation()
$(document).ready(function() {
    $(".clc").click(function(){
         window.location=$(this).find("a").attr("href");
         return false;
    });
    $(".scs").click(function(){
         window.location=$(this).find("a").attr("href");
         return false;
    });
    $('.filtr-container').filterizr();
})

and the line 11 is $('.filtr-container').filterizr();

PS.
#26 I followed this issue and changed the line as well... that didn't fix the issue here

Thank you in advance,

can i exclude all button in that??

Nice Plugin. Great Job.

Only thing i found is -
When i am excluding all button from the filter menu, than it should not show all the items on page!! It should show as per the #no. given in data-filter attribute.

Can you solve this?

typo in the website

typo in the website document in "install div". it should be data-filter, instead of data-fltr. have attached image. it does not work with "data-fltr" attribute. or am i missing something?
filterz

Search and Filter doesn't work with dynamic loading in Safari/Chrome

Hello,

i've a html page which is loading dynamic content from a csv file:

textToInsert[key]=<div class="col-xs-6 col-sm-6 col-md-4 col-lg-3 filtr-item"

data-category="'+obj['Criteria']+'" data-sort="'+obj['Surname']+' '+obj['Name']+'"><div class="card

...

$(textToInsert.join('')).appendTo('#teamMember');

and places this into

The simplefilter, multifilter, and sortandshuffle works after this loading in Firefox4x and IE10, but doesn't work in Safari & Chrome.

I tried to update the CSS classes, hide/show the dom elements, to initialize the filtr-container with filterizr,... but nothing helps. What did i do wrong, is there something that i'm missing??

Hover issue

i written a hover function i.e.. when a image hover i am displaying overlay with content. In this after filtering category wise on hover is coming very slow on first two images some times it is not coming. Is there any solution for this.

How i can use Filterizr in Ajax loaded content?

I have some Categorie results load with Ajax and the Filterizr do not work.

array[0] is undefined is the issue

How i can initailze Filterizr again?

And how it is possible to use in data-category="1, 5" words (string) like data-category="new wheel, other"

Also word with spaces must be possible

Filterizr not working with hamburger menu

I've used Filterizr plug-in for my categories, but after creating a hamburger menu for my website, my categories stopped working. The screens bellow shows the error occurred.
Issue
capture
Code
capture2

Is it possible with infinite scroll function?

Description:

  1. User can filter the items or scroll down the page.
  2. If user filtered the items, while the page is scrolling down, new items attached to the page, and is filtered accordingly. The page will return some strings when data end.
  3. User also can scroll down the page, then reach for the filters. Next, it will filter accordingly.

Current Situation:

  1. I am using php to pull the data from mysql and display it on page. Pagination is used for view more data.

How to do so easily? Use Ajax? I am newbie in JQuery.
So sorry if the question sounds dumb...

Has anyone got the filter list working in an html select list ?

My users filter list has grown to be very large (as its cms populated). So I was thinking of replacing the list tags I have with a select field. I've tried it and the plugin doesn't seem to work out of the box with this.

So I want to confirm, is that correct and if so can I do anything to resolve?

How to display a maximum of n filtr-items

Hi there,

I only ever want to display for instance 6 filtr-items.

What is the best way to go about that? The only thing I could come up with is try to hide them in one of the callbacks.

Regards,

Cameron

In Dnn Script Issue

I am using in about us page in my site two things is there one is login and another one without login. Without login script is working fine with login through dnn script is through an error like "throw new Error('Filterizr: the value of data-category must be a number, starting from value 1 and increasing.');"

Find occurrences that contain each term

Hi,

I've modified the search function in jquery.filterizr.js because I need to find occurs that contain more than one keyword.

Example of needed behavior:

myArray = ["John Doe", "John Brown"];

Search keywords : "Jo Do"
// before modification give me nothing
// after modification, give me "John Doe"


search: function(text) {
            var self   = this,
                //get active category
                array  = self._multifilterModeOn() ?
                            self._makeMultifilterArray() :
                            self._getCollectionByFilter(self.options.filter),
                target = [], i = 0, j = 0;       
            if (self._isSearchActivated()) {
                for (i = 0; i < array.length; i++) {
                    if (text.indexOf(' ') >= 0) {
                        var words = text.trim().split(' ');
                        var confirmation = 0;
                        for (j = 0; j < words.length; j++) {
                            if(array[i].text().toLowerCase().indexOf(words[j].toLowerCase()) > -1) {
                                confirmation++;
                            }
                        }      
                        if (confirmation == words.length) {
                            target.push(array[i]);
                        }
                    }
                    else {
                        var containsText = array[i].text().toLowerCase().indexOf(text.toLowerCase()) > -1;
                        if (containsText) {
                            target.push(array[i]);
                        }
                    }
                }
            }
            //Show the results
            if (target.length > 0) {
                self._handleFiltering(target);
            }
            //If there are no results
            else {
                //and search is activated, show blank
                if (self._isSearchActivated()) {
                    for (i = 0; i < self._activeArray.length; i++) {
                        self._activeArray[i]._filterOut();
                    }
                }
                //if search is not activated display gallery with last applied filter
                else {
                    self._handleFiltering(array);
                }
            }
        }

Hope that can help someone ;)

Inclusive/Excluse filtering mode

hello
I have a few data-multifilter
sample

<ul>
   <li data-multifilter="1"> Green </li>
   <li data-multifilter="2"> Orange </li>
   <li data-multifilter="3"> Purple </li>
</ul>
<ul>
   <li data-multifilter="4"> text1 </li>
   <li data-multifilter="5"> text2</li>
   <li data-multifilter="6"> text3</li>
</ul>

And i have some blocks

<div class="filtr-container">
    <div class="filtr-item" data-category="1,2,4" data-author="John Doe" data-year="1998" data-novel="Cool book 1">
       <img src="img/sample.jpg" alt="sample">
    </div>
    <div class="filtr-item" data-category="1,3,5" data-author="Jane Doe" data-year="2003" data-novel="Cooler book">
       <img src="img/sample.jpg" alt="sample">
    </div>
    <div class="filtr-item" data-category="4,6" data-author="Jake Doe" data-year="2008" data-novel="Coolest book">
       <img src="img/sample.jpg" alt="sample">
    </div>
</div>

in defaul mode if i choice category 1 and 4 Filtterzr result 1 OR 4. But i need 1 AND 4. I need result only data-category="1,2,4"

is there any option to set the sampling algorithm? some INCLUSIVE/EXCLISIVE mode... like this http://wch.io/projects/tagsort/demo-stacks/

Multiple Filtizr on one page

Hey man,

thanks for your work! I'm really enjoying Filterizr on a current project of mine. There is just one point I can't cope with. I would like to set up two galleries on one page with default settings but for the moment the filter controls affect both galleries. I would like to control them separatly. This is a Jekyll project.

This is my two html gallery containers:
https://github.com/Lobotomizer/LS-Page/blob/master/1_artist.html

Here is the main sass file:
https://github.com/Lobotomizer/LS-Page/blob/Filterizr/css/main.scss

This is where I'm initiate Filterizr:
https://github.com/Lobotomizer/LS-Page/blob/Filterizr/js/filterizr-app.js

Here the javascript is called
https://github.com/Lobotomizer/LS-Page/blob/Filterizr/_includes/scripts.html

That should be the most important stuff. Thanks for your help in advance.

Hannes

Height on main wrapper not correct

Hi,

I am using this plugin in two instances on a site I'm developing. In both instances it is working out the height on the main wrapper wrong.

First off, i will mention the height on main wrapper issue.

both instances i am missing a few pixels form the main wrappers height that is auto generated bu the script. on instance i am using the "sameSize" layout, this is missing 20px ish. and the other instance, i am using the "vertical" layout, which is missing about 2 pixels

The vertical layout has a border at the bottom of each item, which is getting cut off on when the filter is set to all. When the filter is set to one of my categories, the border shows fine. There isn't any images within items, just plain text.

                var filterizd = $('.m-client-list').filterizr('setOptions', {
                    layout: 'vertical'
                });

and the css

.m-client-list {
  border-top: 2px solid #646469; }
  .m-client-list-item {
    border-bottom: 2px solid #646469;
    margin-right: 0;
    opacity: 0; }
    .m-client-list-item-content p {
      font-weight: 300;
      font-size: 12px;
      margin: 0;
      padding: 10px 0; }
    .m-client-list-item-title h3 {
      margin: 0;
      padding: 10px 0; }
    .m-client-list-item:after {
      content: "";
      display: block;
      clear: both; }

I'm hoping the problem with the 20 pixels that are missing with be fixed with the issue above. The 20 pixels missing is using the layout "sameSize"

lightbox, fancybox and other

Hello. lightbox, fancybox and other fotos scripts show hidden fotos. I want it will be show only filtered fotos. How do it? Can you help me?
Sorry for my english...

Version problem

Hello @giotiskl ,
I am the member of cdnjs project.
We want to host this library.
But there is a question I want to ask.
I install the library on npm which is the 1.2.4 release version.
But the version in /src/jquery.filterizr.js shows 1.2.3.
Please help me confirm that.
Thanks for your help!

cdnjs/cdnjs#7820

Fix line 948 please - remove space after comma in split function

current line 948:
ret = ret.split(', ');
should be:
ret = ret.split(',');

Thanks, spent about 1 hour trying to figure out why my array to string wasn't working in filter when it turned out to be a f**king space that should not be there. There is no reason to include the space on the split, this is just plain old BAD coding practice.

ability to use String categories instead of numbers

it would be great if you could add support String categories. One option would be using multiple CSS selectors which can be combined to have logical operations and also very flexible filter definition:

<li class="btn-primary filtr-button filtr" data-filter=".cat-1.cat-2"> AND FILTER </li>

<li class="btn-primary filtr-button filtr" data-filter=".cat-1, .cat-2"> OR FILTER </li>

Thank you.

Category 0

First of all, great work, thank you.

I have category = 0 and seems not valid for Filterizr, it is intended? or is a problem on my side?

Multiple id and data-category

Hi,

First, thanks for this nice work.
Is it possible to use simple filter controls with multiple id in data-category ?
Best regards

Bower Package

Yassas @giotiskl, it would be great if you can add this package to bower repository so that one can install with bower too.

Filterizr image height not working with lazyLoading

Hi,

I know in the FAQ section you talk about images not being the right height because they are loaded in the DOM after the plugin has been initialised. So I'm trying it with imagesLoaded with the following:

`jQuery('.filtr-container').imagesLoaded(function() {

        var filterizd = jQuery('.filtr-container').filterizr({
            animationDuration: 0.5, //in seconds
            delay: 150,
            delayMode: 'progressive',
            easing: 'ease-out',
            filter: 'all',
            filterOutCss: { //Filtering out animation
                      
                opacity: 0,
                transform: 'scale(0.5)'   
            },
               filterInCss: { //Filtering in animation
                      
                opacity: 1,
                transform: 'scale(1)'   
            },
           layout: 'sameSize',
           selector: '.filtr-container',
           setupControls: true
        });
    });`

HTML

`


        <div class="filtr-item project-item " data-category="1" data-sort="hello">
          <figure class="fancy-effect">
            <picture>
              <source data-srcset="/assets/img/hello-small.jpg" media="(max-width: 425px)" />
              <source data-srcset="/assets/img/hello-medium.jpg" media="(min-width: 1024px)" />
              <source data-srcset="/assets/img/hello-large.jpg" media="(max-width: 1440px)" />
              <img data-src="/assets/img/webdesign/hello-medium.jpg" alt="hello screenshot" class="lazyload">
            </picture>
            <figcaption>
              <h2 class="project-title">Hello</h2>
              <p class="project-subtitle"></p>
              <p class="project-tech">Wordpress, HTML5, CSS3, SCSS, jQuery</p>
              <a class="project-link" href="#project-item01">View Slides</a>
            </figcaption>
          </figure>
        </div>

      </div>
    </div>`

CSS:

 ` .portfolio,
    .filtr-container {
        display: block;
        position: relative
    }

    .filtr-container {
        margin: 0 auto;
        padding: 1em 0 4em;
        text-align: center;
        float: left;
        display: block;
        margin-right: 13.30108%;
        width: 100%
    }

    .filtr-container {
        float: left;
        display: block;
        margin-right: 8.49092%;
        width: 100%
    }

    .filtr-container .project-item {
        display: block;
        position: relative;
        float: left;
        float: left;
        display: block;
        margin-right: 13.30108%;
        width: 100%
    }

    .project-item figure {
        display: block;
        background: #383838;
        cursor: pointer;
        float: left;
        margin: 15px 1%;
        overflow: hidden;
        position: relative;
        text-align: center;
        width: 100%
    }

    .project-item figure img {
        display: block;
        height: auto;
        max-width: 100%;
        min-height: 100%;
        opacity: 0.8;
        position: relative
    }

    .project-item figure>figcaption {
        -o-backface-visibility: hidden;
        backface-visibility: hidden;
        color: white;
        font-size: 1em;
        height: 100%;
        left: 0;
        padding: 1em;
        position: absolute;
        text-transform: uppercase;
        top: 0;
        width: 100%;
        float: left
    }

    .project-item figure>figcaption::after,
    .project-item figure>figcaption::before {
        pointer-events: none
    }

    .project-item figure>figcaption>a {
        overflow: hidden;
        text-indent: 101%;
        white-space: nowrap;
        opacity: 0;
        z-index: 1000
    }

    .project-item figure>figcaption h2.project-title,
    .project-item figure>figcaption p {
        margin: 0
    }

    figure.fancy-effect {
        background: #D8D8D8
    }

    figure.fancy-effect img {
        max-width: none;
        width: -o-calc(100% + 10px);
        width: calc(100% + 10px);
        -o-transition: opacity 0.35s, -o-transform .35s;
        -o-transition: opacity 0.35s, -o-transform .35s;
        transition: opacity 0.35s, transform .35s;
        -o-transform: translate3d(-10px, 0, 0);
        -o-transform: translate3d(-10px, 0, 0);
        -ms-transform: translate3d(-10px, 0, 0);
        -o-transform: translate3d(-10px, 0, 0);
        transform: translate3d(-10px, 0, 0);
        -o-backface-visibility: hidden;
        backface-visibility: hidden
    }

    figure.fancy-effect:hover img {
        opacity: 0.099;
        -o-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        -ms-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0)
    }

    figure.fancy-effect figcaption {
        text-align: left
    }

    figure.fancy-effect h2 {
        position: relative;
        overflow: hidden;
        padding: .5em 0
    }

    figure.fancy-effect h2::after {
        background: #383838;
        bottom: 0;
        content: '';
        height: 3px;
        left: 0;
        position: absolute;
        width: 100%;
        -o-transition: -o-transform .35s;
        -o-transition: -o-transform .35s;
        transition: transform .35s;
        -o-transform: translate3d(-100%, 0, 0);
        -o-transform: translate3d(-100%, 0, 0);
        -ms-transform: translate3d(-100%, 0, 0);
        -o-transform: translate3d(-100%, 0, 0);
        transform: translate3d(-100%, 0, 0)
    }

    figure.fancy-effect:hover h2::after {
        -o-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        -ms-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0)
    }

    figure.fancy-effect p {
        opacity: 0;
        padding: .3em 0;
        word-spacing: 216px;
        -o-transition: opacity 0.35s, -o-transform .35s;
        -o-transition: opacity 0.35s, -o-transform .35s;
        transition: opacity 0.35s, transform .35s;
        -o-transform: translate3d(-10px, 0, 0);
        -o-transform: translate3d(-10px, 0, 0);
        -ms-transform: translate3d(-10px, 0, 0);
        -o-transform: translate3d(-10px, 0, 0);
        transform: translate3d(-10px, 0, 0)
    }

    figure.fancy-effect:hover p {
        opacity: 1;
        -o-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        -ms-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0)
    }`

Seemingly both 'filtr-container ' and 'filtr-item' laod with the wrong height. I have tried messing around with .lazyload class with some successes but it requires adding loads of media queries to the height at different browser window widths.

I have been trying things for few days now and I'm just wondering if there is a neat way to either get imagesLoaded to work or if I can add a flexible height to the .lazyload/.lazyloaded class? i.e.

    `.project-item {
    	figure {
    		display: block;
        background: $light;
        cursor: pointer;
        float: left;
        margin: 10px 1%;
        overflow: hidden;
    		position: relative;
        text-align: center;
    		width: 100%;


    		img {
    			display: block;
    			height: auto;
    			max-width: 100%;
    			min-height: 100%;
    			opacity: .8;
    			position: relative;

    		          &.lazyload,
    		          &.lazyloaded {
    			     'style that would give me the same height as img/figure no matter the browser width?'
    			}
    		}`

Thanks

Remove "All"

Hi,

How can I start on data-filter="1" and remove data-filter="all" completely?

Thanks.

dimensions cannot be recognized if there were in percentage

The Plugin doesn't show items correctly at the beginning if I use percentage as container or item width.

My code is like this:

.filtr-container {
  width: 100%;
}

.filtr-item {
  background-color: #e1e1e1;
  color: #7f8c8d;
  border: 1px solid #fff;
  padding: 20px;
}

<div class="filtr-container">
   <div class="col-xs-6 col-sm-4 col-md-3 filtr-item" data-category="1">TEXT</div>
</div>

I initialize the plugin on window.load (document.ready has the same effect).

The Problem is width: 100% in filtr-container will be handled as "100" and "col-md-3" handled as "25" and not "25%"

Debugging your code on "_calcItemPositions" method shows these values:

containerHeight = 0,
cols = Math.round(self.width() / self.find('.filtr-item').outerWidth()), ---> self.width() => 100 !!
rows = 0,
//Item data
itemWidth = array[0].outerWidth(), => itemWidth => 25 !!

_calcItemPositions should use Math.floor() instead of Math.round()

cols = Math.round(self.width() / self.find('.filtr-item').outerWidth());

For example if container is 1024px, and tiles are 400px, cols will be calculated as 3, and as result the last tile in row will be only partially visible. In many cases this behavior is not desired, and can be fixed by using Math.floor(). So ideally there should be an option to control this behavior.

Do we have other options for this!!

3 Data Filter Menu Items so it gives 3 content blocks!!

1st Menu item - I used 3 items per row, total 3 rows (1st content block) (item width 300px)
2nd Menu item - I used 1 item per row (2nd block) (item width 780px) (Which is not happening, in that 2nd item is running away out of window)

problem is, i want 3 items per row in scene 1, and 1 item per row in scene 2!! Attached the shots
shot-1
shot-2

is it layout: 'sameSize', related???

Clumping of items with Bootstrap 4

JS Fiddle

In order to stay relevant Filterizr needs to work well with upcoming Bootstrap 4 - the dominating frontend framework.

Bootstrap 4 is major rework of framework. Much changing here.

Me tried to implement Filterizr in Bootstrap 4 alpha v6.

Unfortunately no longer working: Items clump up - forming irregular heaps, instead of evenly distributed grid. Filterizr does not position them correctly anymore.

This is issue with Filterizr + Bootstrap 4, as equivalent example works right in Bootstrap 3.

Good to know: The clumped mess, can be made into intended grid structure on "shuffle".

Yet: Just attaching shuffle at the end of filtering process no solution - as clumping still occurs, yet at lower frequency. It appears shuffle process sometimes not finishing. Shuffle callback not reached, see console log for missing "shuffling ended" message.

JS Fiddle

Instructions:

  1. You may want to use different dimensions of HTML window.
  2. Just hit the filter buttons several times to reproduce issue.
  3. When clumped use shuffle to unclump to get and idea of what is meant.

NOTE: I changed line 85 of jquery.filterizr.js: self.slector -> self to make work good with jqery 3,
as suggested here: other issue

Magento Error: data-category must be a number!

Hello there,

I m using the Filterizr library for the sorting. But I am getting the problem when I declare the data category like this data-category="2, 4" error is "plugins.js:951 Uncaught Error: Filterizr: the value of data-category must be a number, starting from value 1 and increasing."

I don't why it is getting Error. my code is given below please tell me where I am wrong.

   <ul class="simplefilter filters-filteringModeSingle" id="filteringModeSingle">
          <li class="active filtr" data-fltr="all">Customizable</li>
          <li class="filtr" data-fltr="1">Accessories</li>
          <li class="filtr" data-fltr="2">Jewelry</li>
   </ul>
<div class="filtr-container layout-pane filteringModeSingle">
      <div class="col-xs-6 col-sm-4 col-md-2 filtr-item" data-category="2, 4"> <img class="img-responsive" src="{{media url="wysiwyg/media/img1.jpg"}}" alt="sample image"> </div>
      <div class="col-xs-6 col-sm-4 col-md-2 filtr-item" data-category="2"> <img class="img-responsive" src="{{media url="wysiwyg/media/img2.jpg"}}" alt="sample image"> </div>
      <div class="col-xs-6 col-sm-4 col-md-2 filtr-item" data-category="7"> <img class="img-responsive" src="{{media url="wysiwyg/media/img3.jpg"}}" alt="sample image"> </div>
 </div>
jQuery(document).ready(function() {
    var filteringModeSingle = jQuery('.filteringModeSingle').filterizr({
        delay: 25,
        setupControls: false
    });
    //Filtering section nav
    jQuery('#filteringModeSingle li').click(function() {
        jQuery('.filters-filteringModeSingle .filtr').removeClass('active');
        jQuery(this).addClass('active');
        var filter = jQuery(this).data('fltr');
        filteringModeSingle.filterizr('filter', filter);
    });
});

screen1

Responsive Items

Do you have any responsive options, so items will set based on css on mobile and tablet devices?
For example- I have width 33% each column (3 col per row) with a class and on mobile device width is 100%. But with Filterizr it's not working. It's still 3 column per row.

Vanilla JS version?

I am looking for lighter alternatives for isotope.js and found this little thing. Now wondering if you plan on a plain Javascript version anytime soon.

I am also interested in teaming up and developing such a version.

Blank Space on selecting any category except All

This is the function that i am using to call filterizr.

function callFilter(){
if($('body.has-filterizr').length > 0){
var filterizd = $('.filtr-container').filterizr({
delay: 25,
    delayMode: 'progressive',
layout: 'sameWidth'
});
}
}

Issue i am facing is blank space that shows on the bottom as soon i filter using any category other than All.

Can you guide what might be causing this behavior?

capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.