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 8559095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:57:41+00:00 2026-06-11T15:57:41+00:00

This filter works. Each time you select a category from one of the drop

  • 0

This filter works. Each time you select a category from one of the drop down menus (using art terminology as an example), the filtered results are displayed with animation. I just want to make sure there are no glaring code discrepancies or incompatibilities before I move on with the project. Or if you know a more elegant way to achieve the same, please reply. Thanks. Here’s the fiddle:

http://jsfiddle.net/Earl1234/qm5Yj/2/

  • 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-06-11T15:57:43+00:00Added an answer on June 11, 2026 at 3:57 pm

    Well, your #maindiv isn’t using proper HTML syntax, and, when it does, it messes up the layout.

    Shouldn’t you jQuery be a bit more like this though?

    Demo: http://jsfiddle.net/SO_AMK/yrwVZ/

    jQuery:

    $(document).ready(function() {
        $("#genre").change(function() {
            var selGenre = $(this).val();
            var selSize = $("#size").val();
            $("#paintings").slideUp(function() {
                $('.eaPaintDiv, .error').hide();
                $('.eaPaintDiv[class*=' + selGenre + '][class*=' + selSize + ']').show();
                if ($('.eaPaintDiv[class*=' + selGenre + '][class*=' + selSize + ']').length == 0) {
                    $(".error").show();
                }
                $("#paintings").slideDown();
            });
        });
        $("#size").change(function() {
            var selGenre = $("#genre").val();
            var selSize = $(this).val();
            $("#paintings").slideUp(function() {
                $('.eaPaintDiv, .error').hide();
                $('.eaPaintDiv[class*=' + selSize + '][class*=' + selGenre + ']').show();
                if ($('.eaPaintDiv[class*=' + selSize + '][class*=' + selGenre + ']').length == 0) {
                    $(".error").show();
                }
                $("#paintings").slideDown();
            });
        });
    });​
    

    I added the error for appearances sake.
    Your filtering is slightly redundant and could possibly mess up if you only hide the selected paintings initially. So, instead, you can just hide them all then show the correct ones.

    P.S. You can use my float clearing method, instead of an empty DIV, like this:

    #paintings:after {
        display: block;
        content: " ";
        height: 0;
        clear: both;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've this servlet filter servlet called everytime a file from Restricted folder is called.
i filter the intent like this <intent-filter> <action android:name=android.nfc.action.NDEF_DISCOVERED/> <category android:name=android.intent.category.DEFAULT/> <data android:mimeType=text/plain />
Consider a simple each loop to inspect checked checkboxes: $(':checkbox').filter(':checked').each(function(){ var name = $(this).val();
Sorry but why can't this work: function filter($var) { return($var['id'] < 4); } $t1
I'm trying to work on this website wherein I need to filter the data
In a few different guises I've asked about this filter on here and WPSE.
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I wrote this ISAPI filter to rewrite the URL because we had some sites
I have a list areas :: [Double]. Now I want to filter this list
I'm trying to use translation in a custom twig filter like this public function

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.