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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:29:02+00:00 2026-06-11T15:29:02+00:00

I have a portfolio page which you can select a project and it will

  • 0

I have a portfolio page which you can select a project and it will show more detail.

I have a fiddle: http://jsfiddle.net/TxKqx/

What I want to do is if a user has already selected a project to view, if they select another for the other one to deselect and fade the detail out.

I have the following code to open and select the projects:

$('.widget-item-expand').click(function() {
        $(this).parent().toggleClass("selected");
        var currentId = $(this).parent().attr('id');
        var currentIdfull = "#"+currentId+"-full";
        $('#port-full-item').css("height","320px");
        $('#port-full-item').slideDown('slow');
        $(currentIdfull).css("height","320px");
        $(currentIdfull).fadeToggle('slow');
});
​

I have tried this method to solve it but it doesn’t work: (not this exact code)

if ($('#elm').is('.selected')) {
//#elm has the class
} else {
//#elm doesn't have the class
}

Any help would be appriciated.

  • 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-11T15:29:03+00:00Added an answer on June 11, 2026 at 3:29 pm

    I hope I have understood well what you want.

    See http://jsfiddle.net/TxKqx/2/

    $('.widget-item-expand').click(function() {
        $(this).parent().siblings('.selected').removeClass('selected');
        $(this).parent().toggleClass("selected");
        $('#port-full-item')
            .addClass('selected')
            .css("height","320px")
            .slideDown('slow');
        var currentId = $(this).parent().attr('id'),
            $prevFull=$(".widget-full.selected");
        if(currentId+'-full'!==$prevFull.attr('id')){
            $prevFull
                .hide()
                .removeClass('selected');
        }
        $("#"+currentId+"-full")
            .addClass('selected')
            .css("height","320px")
            .fadeToggle('slow');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a portfolio application that lists projects and their detail pages. Every project
On my portfolio page I have this setup: <div id=portfolio> <ul id=sites> <li> <h3><a
I am creating a portfolio page for m personal site. I have a slider
I am creating a portfolio page for m personal site. I have a slider
I'm trying to create a simple portfolio page. I have a list of thumbs
I have created my Portfolio and put there a Google+ button. The page is
I want to have a 404 page that can detect if a user has
Ive created a portfolio website for myself, there is a gallery which users can
I have a page which lists a load of portfolios. I am trying to
I have a site w/ an image gallery (Portfolio) page. There is drop-down navigation

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.