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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:45:38+00:00 2026-05-26T14:45:38+00:00

I don’t understand why the images vanish when I click on a filter. The

  • 0

I don’t understand why the images vanish when I click on a filter.

The Quicksand script code (located in the file called jquery.custom.js):

jQuery.noConflict();
jQuery(document).ready(function($){
    // Clone applications to get a second collection
    var $data = $("#portfolio-items").clone();

    //NOTE: Only filter on the main portfolio page, not on the subcategory pages
    $('#portfolio-terms ul li').click(function(e) {
        $("ul li").removeClass("active");   
        // Use the last category class as the category to filter by. This means that multiple categories are not supported (yet)
        var filterClass=$(this).attr('class') //.split(' ').slice(-1)[0];
        filterClass = filterClass ? filterClass.split(' ').slice(-1)[0] : '';

        if (filterClass == '.all current') {
            var $filteredData = $data.find('#portfolio-');
        } else {
            var $filteredData = $data.find('#portfolio-[data-type=' + filterClass + ']');
        }
        $("#portfolio-items").quicksand($filteredData, {
            duration: 800,
            easing: 'swing',
        });     
        $(this).addClass("active");             
        return false;
    });
});

Here you can see the PHP code of portfolio-items and terms: http://snipt.org/Mnp8

Can you help me please?
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-26T14:45:38+00:00Added an answer on May 26, 2026 at 2:45 pm

    The $data.find is not searching through attributes directly. What would work is something like replacing

    var $filteredData = $data.find('#portfolio-');
    

    with

    var $filteredData = $data.find('li[id|="portfolio"]');
    

    That will search through all li’s where the id starts with portfolio

    The following line is referring the the LI, NOT to the a tag. There is no class on the LI element.

    $(this).attr('class') //.split(' ').slice(-1)[0];
    

    assuming that you put the class on the LI element, you might be able to modify change this line from (I’m not sure about this one):

    var $filteredData = $data.find('#portfolio-[data-type=' + filterClass + ']')
    

    to:

    var $filteredData = $data.find('li.' + filterClass);
    

    Please take a look at
    http://jsfiddle.net/bhoover10001/SzjhS/
    and see if this is more or less the functionality that you want.

    A) You didn’t put the class on the LI items that are being clicked on.

    <li class="all"><a href="">All</a><span>/</span></li>
    <li class="term-4"><a href="" 
    data-value="term-4" title="View all items filed under Colours">Colours</a> <span>/</span>
    </li>
    <li class="term-3" >
    <a href="" data-value="term-3" title="View all items filed under Fotografie">Fotografie</a> <span>/</span>
    </li>
    

    B) data-id is a required element on the LI element of the items that you are displaying. For example:

    <li id="portfolio-12" class="term-4 visible" data-id="post-12">
    

    C) The filter class should be the first class in each of the portfolios. You were splitting out the filter class wrong:

    filterClass = filterClass ? filterClass.split(' ')[0] : '';
    

    D) Your “ALL” condition was coded wrong:

    if (filterClass == 'all')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't be scared of the extensive code. The problem is general. I just provided
I don't know why, but this code worked for me a month ago... maybe
Don't think that I'm mad, I understand how php works! That being said. I
Don't be frightened, its a very basic code. Just wanted to check with you
Don't they both have to convert to machine code at some point to execute
Don't know if this has been answered before. Have custom routes to users. If
don't understand: in my controller: @json = User.all.to_gmaps4rails do |user| \Title\: \#{user.email}\ end in
Don't understand, if Data.Map is and [] is. I found this out while wondering
Don't quite understand determinism in the context of concurrency and parallelism in Haskell. Some
Don't think there's much to say, here's my code for (int i = 0;

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.