Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6669169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:07:08+00:00 2026-05-26T03:07:08+00:00

I am trying to build a simple jQuery filter system to show and hide

  • 0

I am trying to build a simple jQuery filter system to show and hide elements of various categories.

The problem is that some elements belong multiple categories and should remain visible even if one of the filters is turned off.

The most logical solution I can think of is to, after toggling a filter item, to see which categories are still set to be visible, and to hide the elements that aren’t.

Thus my problem lies in trying to figure out how to select elements that don’t have any of the given classes.

I am trying to find the checked categories (each filter item has an id: filter-category_name ):

$('.filter-checked').each(function(){
    checkedCategories = checkedCategories + ('.' + $(this).attr('id').replace('filter','category'));
});

And then fade out the elements which do not have a class of an item that is no longer checked:

$(filterCategory).filter(function(){
return $(not(checkedCategories));
}).fadeTo(500,0.1);

where:

var filterCategory = '.'+$(this).attr('id').replace('filter','category');

(which is the filter item that was clicked)

I am thinking that the main issue lies in trying to find specifically the items that don’t have any class of items that are still checked, but apart from solving the issue with my current solution, if there is an obvious and more elegant way to solve this issue it would be fantastic.

Thank you!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:07:08+00:00Added an answer on May 26, 2026 at 3:07 am

    I believe what you’re looking for is the not method:
    http://api.jquery.com/not/

    You’ll provide it with a selector with the classes you want to exclude from the original selection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a simple jquery plugin that can take selectors as parameters.
I'm trying to build a simple Magento Module that needs to connect to the
I am starting to I am learning scala, and trying to build some simple
I am trying to build a simple calculator to learn javascript/jquery but seem to
Im trying to build a simple, lightweight product viewer using jquery. I have a
I'm trying to build a jQuery plugin that filters the provided jQuery object to
I am trying to build a simple vertical thermometer with CSS. I took some
I'm trying to build a simple carousel animation with jQuery. There are 3 viewable
I'm trying to build a simple alert mechanism with jQuery Tools -- in response
I am new to Jquery and and trying to build a simple gallery. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.