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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:11:28+00:00 2026-06-16T22:11:28+00:00

I’m asking this first question because I’m quite stuck with this following code. Basically

  • 0

I’m asking this first question because I’m quite stuck with this following code.

Basically : I’d like to toggle divs visibility by filtering them, based on a specific content.
Each div contains several “tags”. When a “tag” is clicked, only divs that contains same “tag” get displayed. Looks simple said like that.

But I’m running inside an isotope div container. More important, there is no external tag menu, so the trigger is right inside the div that will be toggled.

I’m facing 2 paths :
1. Go with an additional isotope plugin from Gatsby : IsoSelective and it goes like this:

$container.isoSelective({
    linkSelector: '.filter',    // this is the filter link 
    attrSelector: 'rel',           // the attribute containing the filter
    activeClass: 'selected'        // class to add to selected
});

But doesn’t seem to be happy if my triggers are inside the targets.

  1. A fork I did on an existing JSFiddle code which work awesome but cannot run inside isotope until now :

    http://jsfiddle.net/gVpqx/3/

—————

And finally here is my an extract from my code in html page :

<div class="articlesBlock">
<div class="blockBox">
<a href="#"><p>Lorem ipsum paragraph.</p></a>   
<em><a class='filter base-first-tag' rel='.first-tag' href='#'>The Base First Tag</a></em>
<em><a class='filter second-tag' rel='.second-tag' href='#'>The Second Tag</a></em>
<em><a class='filter third-tag' rel='.third-tag' href='#'> The Third Tag</a></em>
</div>  
</div>

<div class="articlesBlock">
<div class="blockBox">
<a href="#"><p>Lorem ipsum paragraph.</p></a>   
<em><a class='filter base-first-tag' rel='.base-first-tag' href='#'>The First also Base Tag</a</em>
<em><a class='filter second-tag' rel='.second-tag' href='#'>The Second Tag</a></em>
<em><a class='filter third-tag' rel='.third-tag' href='#'> The Third Tag</a></em>
</div>  
</div>

<div class="articlesBlock">
<div class="blockBox">
<a href="#"><p>Lorem ipsum paragraph.</p></a>   
<em><a class='filter first-tag' rel='.first-tag' href='#'>The First Tag</a></em>
<em><a class='filter second-new-tag' rel='.second-new-tag' href='#'>The New Second Tag</a></em>
<em><a class='filter third-tag' rel='.third-tag' href='#'> The Third Tag</a></em>
</div>  
</div>

Below is the JSFiddle with the IsoSelective approach, but still doesn’t work.

http://jsfiddle.net/48nh6/1/

What do you think ?

Thanks

  • 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-16T22:11:29+00:00Added an answer on June 16, 2026 at 10:11 pm

    So here’s what’s going on: isoSelective acts as a toggle. Individual filters can be on/off in combinations — not just one filter on vs one filter off. Not sure if that’s what you want, but here’s an example. I made the active (selected) class bold for demonstration.

    http://jsfiddle.net/48nh6/4/ NOte that in this version, I moved the tag classes to the container — not on the anchors themselves. Since you want to show/hide (filter) the blocks and not the links, the tag classes need to be moved up to the top level.

    1. Using the top nav filters (not in the isotope list) click All. Notice, it goes “off” and all elements are hidden.
    2. Click First Tag. Note that it goes bold.
    3. Click Third Old Tag. Note that it is also bold; First Tag stays bold. Now you see two items — one with Old First and one with Third Old.

    Now. You can repeat the same exercise with the tags internal to the isotopes.
    1. Make sure “All” is toggled at the top nav
    2. Click Third Tag in the first box. Note only two items active
    3. Click The Base First Class in the first box. Note all three now appear.

    Also notice that the tags are only “active” in the first box. If you click “The First and also Base Class” in Box 2, it toggles “active” but it was already active because of the first one! So nothing changes (except the text becomes bold).

    I offer two alternatives:

    1. If you want the inclusive nature like isoselective (taht is, toggle instead of exclusive filters) then you wire up isoselective to a top-level filter and “faux click” it when an internal filter is clicked.
    2. If you don’t want the inclsuive nature like isoselective, then cook your own solution.

    Option 1: http://jsfiddle.net/gy8Xf/1/

    $container.isoSelective({
        linkSelector: '#filters .filter',
        attrSelector: 'rel',
        activeClass: 'selected'
    });
    

    Select only on #filters .filter, then…

    $container.find('a').click(function()
                               {
                                   var rel = $(this).attr('rel');
    
                                   // get all the #filters .filter elements that have the same rel
                                   var $filters = $('#filters .filter').filter(function()
                                                                {
                                                                    return $(this).attr('rel') == rel;
                                                                });
    
                                    // trigger a click
                                   $filters.click();
    
                               });
    

    Anytime a link is clicked inside container, find the #filters .filter with the same rel attribute as the link that was just clicked, and trigger a click.

    Option 2: http://jsfiddle.net/9ThvU/1/

    $('#filters .filter, #content .filter').click(function()
                               {
                                   var rel = $(this).attr('rel');
    
                                   $container.isotope( {filter: rel});
                               });
    

    Simply, anytime an anchor is clicked (I kept the #filters, not sure if you want them) set the new isotope filter according to the rel attribute.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.