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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:46:05+00:00 2026-06-17T06:46:05+00:00

Hi I am currently doing a project that requires me to sort and filter

  • 0

Hi I am currently doing a project that requires me to sort and filter products on a page using jQuery. I have my script working perfectly showing and hiding results based on the user selection however I want the animations between transitions to run differently. I have them set already using fadeOut and fadeIn. But was wanting to make use of the .effects feature of jQuery. I’m not sure where I’m going wrong or if I can even use it. See my code below. Heres my full script using fade.

 $(document).ready(function() {
$('ul#filter a').click(function() {
    $(this).css('outline','none');
    $('ul#filter .current').removeClass('current');
    $(this).parent().addClass('current');

    var filterVal = $(this).text().toLowerCase().replace(' ','-');

    if(filterVal == 'all') {
        $('ul#selection li.hidden').fadeIn('slow').removeClass('hidden');
    } else {

        $('ul#selection li').each(function() {
            if(!$(this).hasClass(filterVal)) {
                $(this).fadeOut('slow').addClass('hidden');
            } else {
                $(this).fadeIn('slow').removeClass('hidden');
            }
        });
    }

    return false;
});

});

Below is my attempt at using the effect with fold.

 $('ul#selection li').each(function() {
        if(!$(this).hasClass(filterVal)) {
            $(this).effect('fold','slow').addClass('hidden');
        } else {
            $(this).fadeIn('slow').removeClass('hidden');
        }
    });
}

Can someone point out where I’m going wrong?

  • 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-17T06:46:07+00:00Added an answer on June 17, 2026 at 6:46 am
    1. Make sure you are including jQuery UI
    2. Try this: $(this).effect('fold','slow', function(e) { $(this).addClass('hidden'); })

    If you just chain .addClass() directly after the .effect(), it will happen immediately, rather than when the effect is complete. Therefore, if your .hidden class actually hides things with CSS, they will seem to disappear right away, before you notice the fold effect. So .addClass() should be a callback to .effect() instead.

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

Sidebar

Related Questions

I'm currently working on a project that requires that I have a div stacked
I'm currently working on a project that requires me to match our database of
I am currently working on a project that requires the use of SVN on
I am working on a website project that requires ruby 1.8.7 and using am
I'm using a gsm modem itengo 3800. I'm currently doing a project that interface
I am doing a project that currently requires a list and when a particular
I am currently doing a project in C# that requires rendering MathML for the
Hi i am currently doing a school project using cakePHP. I have the following
I am currently doing a project in which I have to request data from
I'm currently doing a project in C# working with windows forms. During the course

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.