Introducing Filterizr, the innovative gallery filter plugin with a unique mix filter mode

I am currently working on implementing the Filterizr plugin () into my project. I specifically require the mix filter feature as demonstrated on this tutorial page .

Upon clicking the mix button, as shown in the screenshots, only orange and purple blocks should be displayed - this is exactly what I need, but unfortunately, it is not functioning correctly.

I have attempted to build my own demo using the plugin, but have not been successful in getting it to work.

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="583a37372c2b2c2a3928186d7669766b">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/filterizr/2.2.4/jquery.filterizr.min.js"></script>
    <title>Hello, world!</title>
  </head>
  <body>
    <h1>filter</h1>
    <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bcded3d3c8cfc8ceddccfc89928d928f">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
    
    <div class="container">
        <div style="cursor:pointer;" class="col-md-12 col-xs-12">
            <ul>
                <li data-filter="all">All</li>
                <li data-filter="1">1</li>
                <li data-filter="2">2</li>
                <li data-filter="1,2">1 and 2</li>
            </ul>
        </div>
    </div>
  <h1>items</h1>
     <div style="margin: 40px;" class="row filtr-container">
     
         <div style="border: 4px black;" class="col-md-2 col-sm-6 filtr-item"  data-category="all,1">
         <span>1</span>
         </div>
         
         <div style="border: 4px black;" class="col-md-2 col-sm-6 filtr-item"  data-category="all,2">
         <span>2</span>
         </div>
                 
         <div style="border: 4px black;" class="col-md-2 col-sm-6 filtr-item"  data-category="all">
         <span>3</span>
         </div>
         
     </div>
    <script>
    $('.filtr-container').filterizr({});
    </script>
    
  </body>
</html>

Upon clicking the "1 and 2" filter, I expect to see items labeled 1 and 2, similar to the example shown on this tutorial with the Mix option, however, I am encountering difficulties. I am currently stuck and would appreciate any guidance or advice.

Answer №1

Successfully resolved the issue =) - migrated to Shuffle.js ()

The plugin works seamlessly and is available for commercial use.

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9af8f5f5eee9eee8fbeadaafb4abb4a9">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Shuffle/5.4.1/shuffle.min.js" integrity="sha512-26vtWkj1Yt/eY2Ykb7TO/RzzysOKS7zaD/055jS+2IW4DX89qlH/HziTFqfzMLAxpFVpYhPWgTdCcavzf8Qs8g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <title>Hello, world!</title>
  </head>
  <style>
  #grid {margin-left:-5px;margin-right:-5px;position:relative; overflow: hidden;}
  #grid [class*="col-"] {padding:5px;}

@media (max-width:320px) {
   #grid [class*="col-"] {width:100%;}
}


.shuffle_sizer {
  position: absolute;
  opacity: 0;
  visibility: hidden;
}
  </style>
  <body>
    <h1>filter</h1>
    <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b2924243f383f392a3b0b7e657a6578">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
    
    <div class="container">
        <div style="cursor:pointer;" class="col-md-12 col-xs-12 filter-options">
            <ul class>
                <li data-group='["all"]'>All</li>
                <li data-group='["1"]'>1</li>
                <li data-group='["2"]'>2</li>
                <li data-group='["1","2","prem"]'>1 and 2 and prem</li>
            </ul>
        </div>
    </div>
  <h1>items</h1>
     <div style="margin: 40px;" id="grid" class="row">
     
         <div style="border: 4px black;" class="col-md-2 col-sm-6 filtr-item"  data-groups='["all","1"]'>
         <span>1</span>
         </div>
         
         <div style="border: 4px black;" class="col-md-2 col-sm-6 filtr-item"  data-groups='["all","2"]'>
         <span>2</span>
         </div>
                 
         <div style="border: 4px black;" class="col-md-2 col-sm-6 filtr-item"  data-groups='["all"]'>
         <span>3</span>
         </div>
         
         <div style="border: 4px black;" class="col-md-2 col-sm-6 filtr-item"  data-groups='["all","prem"]'>
         <span>prem</span>
         </div>
         
               <!-- sizer -->
      <div class="col-xs-6 col-sm-4 col-md-3 shuffle_sizer"></div>  
         
     </div>
    <script>
    var Shuffle = window.Shuffle;
var $grid = $('#grid');
var sizer = $grid.find('.shuffle_sizer');

var shuffleInstance = new Shuffle($grid, {
  itemSelector: '.filtr-item',
  sizer: sizer // could also be a selector: '.shuffle_sizer'
});

$('.filter-options').on('click','li',function(){
     let currFilterName = $(this).data('group');
     shuffleInstance.filter(currFilterName);
});
    </script>
    
  </body>
</html>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the method for displaying a div adjacent to a password input field?

I am attempting to display a password verification box next to an input field. The current logic is functioning properly, but the box containing all password requirements is not appearing in the correct position. Instead of being positioned adjacent to the ...

Impossible to create margins on both the left and right side

Check out this cool pen: http://codepen.io/helloworld/pen/BcjCJ?editors=110 I'm facing an issue where I'm unable to create both left and right margins around my datagrid. Only the left margin seems to be possible. Any suggestions on how I can f ...

Utilizing jQuery and CSS to make an entire div clickable, and activate an 'a' tag hover state upon hovering

Looking to create a clickable link for the .wrapper div that directs users to the location of a.icon. Want the .wrapper div to activate the a.icon:hover state when hovered over, not just when hovering over the icon itself. Any assistance would be highly a ...

What steps can I take to ensure that the v-main element occupies at least 70% of the viewport height in Vuetify?

As a newcomer to Vuetify, I am still learning the ropes. One thing I've noticed is that <v-main> automatically expands to fill the space between <v-app-bar> and <v-footer>, taking up the entire viewport height. My concern arises wh ...

What could be the reason for my React/HTML select element occasionally failing to display the default selected value?

I am currently working on creating a select element in Reactjs/HTML and I am facing an issue with setting a default value based on a component variable. Essentially, the default value of the select should be the id of a component. This is my current imple ...

Ways to retrieve information from a JSON entity

When dealing with both a normal array and a multidimensional array in PHP, how can I access them in jQuery after returning them using json_encode? $data['normalArray'] = $array; $data['multiArray'] = $multiArray; echo json_encode($dat ...

Using an HTML element to pass a variable into a replace function

I am looking to highlight a 'SearchString' by replacing it with <span style="background-color: yellow">SearchString</span> within a targetString. The SearchString varies, so I am wondering how I can make this happen. This is what I ...

A button featuring an extensive label that utilizes text-overflow ellipsis is initially set with a max-width of 700px. However, it should dynamically shrink when the viewport size decreases

My Request I need a button that can accommodate both long and short labels, with the text getting cut off at 700px using ellipses. The button should adjust to the available space when the viewport is smaller than 700px. The length of the label can vary gr ...

Is there a way to have a dropdown menu automatically expand when a selection is made in a different dropdown menu?

Within this product upload form, I have integrated five cascading drop-down lists using HTML, complemented by embedded Javascript to dynamically fill the options in these lists. My main query pertains to enabling the second drop-down list to appear automat ...

What is the best way to design a table to allow for changing the colors of specific boxes in the table when clicked?

I am looking to create a feature where the elements in this table change color from the background color to red and back to the default color when they are clicked. Can anyone help me achieve this? <table align="center" style="height: 355px;" width=" ...

Is your iPhone struggling to display animation sprites correctly?

After testing on Android and iPhone, I found that the website works great on Android but lags on iPhone. I suspected that the issue might be related to image preloading, so I tried adding a simple jQuery preloader, but it didn't solve the problem. Th ...

Tips for executing an Angular controller prior to DOM initialization

I have some code in my Angular controller that I want to run when the document is ready, but Angular currently runs it as the DOM is being created. While this does produce the correct output, it also generates console errors because initially the image src ...

Using `justify-content: space-around` on a nested element within a class will not produce the desired spacing effect

This particular piece of code is functioning correctly: aside { /* Customize styles for the aside element */ flex: 0 0 40px; display: flex; flex-direction: column; justify-content: space-around; align-items: center; background-color: #2800da; ...

Is there a way to dynamically disable an MVC Razor @Html.TextBoxFor depending on the selection made in a drop-down menu on the same page?

Consider the scenario where the following code is present. @Html.DropDownListFor(m => m.MyWebPage, Model.FruitsList, "Select", htmlAttributes: new { @class = "form-select detailsInfo" }) Within this dropdown menu, there is an option ...

JavaScript's Ajax request encounters issues while running on Internet Explorer

Here is the code I'm using to retrieve data objects from a remote site and display them on another site. While this code works perfectly in Chrome and Firefox, it throws a "Permission denied" error in IE. I've tried adding Access-Control-Allow- ...

Customize HTML Textbox Styles

I am currently working on customizing the appearance of textboxes and labels by applying color themes to them. My goal is to achieve a visual effect like this: https://i.sstatic.net/JdjnU.png Do you know of any tools or methods that can help me accom ...

Incorrect Media Queries breaking LayoutNote: This is a completely unique rewrite

My golden rule for media queries is set... @media only screen and (min-width: 768px) and (max-width: 1080px) { Strangely, I picked 1080 as a test number... Unexpectedly, the background color changes at 1190px when resizing my page to test breakpoints. ...

Removing a row from a table seamlessly without the need to reload the page

I am having an issue with my page that displays a list of orders. When a user clicks on a button to delete a row from the table, it only removes the first row successfully. However, when attempting to delete the second or third row, it does not work. Can s ...

Image swaps with timer for button

I am working on a project where I have a page with 5 image buttons arranged horizontally. The objective is to have the images on each button change sequentially every 3 seconds in a continuous loop. Here is my code: $(document).ready(function (){ Beg ...

The width of the navigation bar adjusts after it becomes fixed to the top of the page

When scrolling past the navigation bar, it sticks to the top but expands beyond the container width. How can this issue be resolved so that the navigation bar retains its original width? Check out my code on GitHub: https://github.com/Archiie/MyPortfolio ...