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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:17:03+00:00 2026-06-07T18:17:03+00:00

Sandbox code below (using the jQuery Isotope layout and sorting plugin). What shall happen:

  • 0

Sandbox code below (using the jQuery Isotope layout and sorting plugin). What shall happen:

  1. If an .item is clicked, it shall grow to reveal more of its content (.maximise)
  2. If that same .item is clicked again, it shall shrink to hide most of its content (.minimise)
  3. If any other .item is clicked, it shall do 1. and all others shall do 2.

    $items = $('.item'); // solution
    
    $('.item').click(function () {
    
    var $this = $(this);
    var $previousSelected = $('.selected');
    
    if ($(this).hasClass('selected')) {
    
        $items.not(this).find('.slideshow').removeClass('transparent'); // solution
    
        $(this).removeClass('selected');
        $(this).children('.maximise').hide();
        $(this).children('.minimise').show();
    
    } else {
    
        $items.not(this).find('.slideshow').addClass('transparent'); // solution
    
        $previousSelected.removeClass('selected');
        $previousSelected.children('.minimise').show();
        $previousSelected.children('.maximise').hide();
    
        $(this).addClass('selected');
        $(this).children('.minimise').hide();
        $(this).children('.maximise').show();
    }
    
    // $container.isotope('shuffle'); uncomment to always randomise layout
    // $container.isotope('reLayout'); uncomment if no sorting logic is used
    $container
    .isotope('updateSortData', $this)
    .isotope('updateSortData', $previousSelected)
    .isotope();
    });
    

Thanks a lot in advance!

EDIT Found .find(). and then .not() methods and then realised to just store all Isotope elements in $items = $(‘.item’);

  • 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-07T18:17:05+00:00Added an answer on June 7, 2026 at 6:17 pm

    You can do this with jQuery’s addClass method. jQuery will check to see if the .transparent class is already set on the element before it adds it in.

    $($previousSelected).children('.minimise').addClass('transparent').show();
    

    You may also want to remove the transparent class when you hide it, in which case I would remove the class after .hide():

    $($previousSelected).children('.maximise').hide().removeClass('transparent');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this chat plugin: http://sandbox2.pseudocoder.com/demo/chat In chat.js, I tried using the below
A tutorial I'm following created a form using the code below. The teacher's form
I'm trying to run a piece of code in a sandbox. It failed and
Is there any Google Analytics testing/sandbox environment for testing your JS custom code before
the code below explains the problem in detail #this returns error Net::HTTPBadResponse url =
I wanna create Contextual Tab using Webpart In Sandbox Solution..that time I am getting
The below code will not join, when debugged the command does not store the
I have a bit of f# code (below) that takes a unit->obj and evaluates
I am creating a store using Active Merchant and PayPal sandbox right now. It
I have the below code in a .Net 4 Winforms app which loads an

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.