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

  • Home
  • SEARCH
  • 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 8132421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:20:46+00:00 2026-06-06T09:20:46+00:00

Ok so I’m using the quicksand jquery filter. now I want to add a

  • 0

Ok so I’m using the quicksand jquery filter. now I want to add a particular effect (which I’ve typed in javascript) to all the images when any of the filters are selected. The filter list is as follows:-

<ul class="filter"> 
   <li class="current all"><a href="#">Fred</a></li> 
   <li class="daisy"><a href="#">daisy</a></li> 
   <li class="richard"><a href="#">richard</a></li> 
   <li class="ama"><a href="#">ama</a></li> 
   <li class="santy"><a href="#">santy</a></li> 
   <li class="washington"><a href="#">washington</a></li> 
   <li class="deuces"><a href="#">deuces</a></li> 
</ul> 

So I’m using the following syntax to determine the selected filter and work some jquery ‘magic’ from there.

    $(".filter a").click(function(e){

    $(".filter li").removeClass("current"); 

    // Get the class attribute value of the clicked link
    var $filterClass = $(this).parent().attr("class");

    if ( $filterClass == "all" ) {
        var $filteredPortfolio = $portfolioClone.find("li");
    } else {
        var $filteredPortfolio = $portfolioClone.find("li[data-type~=" + $filterClass + "]");
        $filteredPortfolio.addClass("row3");
    }

Now to add the special effect to the all the images of the selected filter (say photography), I added this code $("$filteredPortfolio").addClass("row3") which you see on the last line basically because the effect works on all elements with the class row3 yet when I debug this in my browser, it fails to work. What am I doing wrong? I still consider myself a jquery newbie so please pardon me if the answer is obvious.

  • 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-06T09:20:48+00:00Added an answer on June 6, 2026 at 9:20 am

    Your last line should be:

    $filteredPortfolio.addClass("row3");
    

    .find() is alrady producing a jQuery object, so there’s no need for the extra $()

    You are filtering on [data-type=..], which is fine if there is a data-type attribute defined in HTML, but won’t work if you are setting it via the .data(‘type’, val) jQuery api. For the filter to find it, you must use .attr(‘data-type’, val). Newer versions of jQuery better differentiate between data and attributes, which are actually separate things. jQuery used to conflate them and using them interchangeably might have worked in an older version.

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

Sidebar

Related Questions

I am using this example of quicksand jQuery. Making a Beautiful HTML5 Portfolio Now,
I'm using the jQuery Quicksand plugin to filter a list by dates. I've got
I'm using http://razorjack.net/quicksand/ this jquery. I want to select 'application' instead of 'everything' in
Using jQuery, one can easily find out whether a particular element is visible using
I am using the Quicksand jquery scripts on an HTML page and using simple
using a binary search tree I need to add to a vector all int
Using Yii, I want to delete all the rows that are not from today.
I am using the jQuery Quicksand plugin -- http://jsfiddle.net/se9pY/ but I get rawDestElement is
Using JQuery, how do I select all elements with class x within an element
I'm using jQuery Quicksand to create a filterable portfolio of articles: http://davekiss.com/new/ The problem

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.