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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:48:17+00:00 2026-06-08T19:48:17+00:00

Im struggling to build a proper project filter with jquery isotope. I only want

  • 0

Im struggling to build a proper project filter with jquery isotope. I only want to get the id’s of previous and next projects if they are not hidden by the ‘isotope-hidden’ class. How can I do this?

// Get the id's of previous and next projects
if ( $prev.length !== 0 && $next.length !== 0 ) {
    prev_item_id = $prev.find('.project-link').attr( "data-post_id" );
    next_item_id = $next.find('.project-link').attr( "data-post_id" );
}
else if ( $prev.length !== 0 ) {
    prev_item_id = $prev.find('.project-link').attr( "data-post_id" );
}
else if ( $next.length !== 0 ) {
    next_item_id = $next.find('.project-link').attr( "data-post_id" );
}

the problem is I need to put the logic in here somewhere. But I can’t work out how to adapt this to exclude projects hidden by the isotope-hidden class. Is it something like this?

var post_id = $( this ).attr( "data-post_id" );
        current_post_id = post_id;

        var nonce = $( this ).attr( "data-nonce" );
 var $allitems = $('.project-link').not('isotope-hidden');
        var $prev = $allitems.[data-post_id="' + post_id + '"]' .parent().parent().prev('.portfolio-item');
        var $next = $allitems.[data-post_id="' + post_id + '"]' .parent().parent().next('.portfolio-item');

Any help much appreciated, 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-08T19:48:19+00:00Added an answer on June 8, 2026 at 7:48 pm

    Try the following:

    function getHiddenIds($element) {
        return $('.project-link:not(.isotope-hidden)', $element).data('post_id');
    }
    var prev_item_id = getHiddenIds($prev);
    var next_item_id = getHiddenIds($next);
    

    References:

    • :not(): http://api.jquery.com/not-selector/
    • .data(): http://api.jquery.com/jQuery.data/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After some struggling I managed to get boost smart pointers to build for Windows
I'm struggling a lot trying to get our build server going. I am currently
I have to build a quiz and I am struggling to get two arrays
I'm struggling to build a simple zend framework application that can call jQuery. So,
I'm struggling to create a custom build for a Range Slider. My slider works
Struggling to get any list function to work. I've been fine with _show and
struggling a bit to get the following to work : I'm trying to merge
I'm new to Postgresql and struggling to build a function for looping over a
I'm struggling with the idea of how to build an expression tree for more
I need to build Special Java Api to wrap Magento Api. After struggling with

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.