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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:23:23+00:00 2026-05-28T20:23:23+00:00

I am having troubles with this code. It’s supposed to do this: Start the

  • 0

I am having troubles with this code. It’s supposed to do this:

  1. Start the function with clicking on an element with class “portfolioImage”.
  2. Fade out all the elements with class “image”.
  3. Fade in element with class “image” and id of the “portfolioImage” (lets say the id of portfolioImage is 3, so fade in the elements that has class image and id 3).
  4. Fade out an element with id “portfolioHolder” and fade in another element with class “details”.

Parenting:
#portfolioHolder (visible at the start of the function)
.portfolioImage
#details (invisible at the start of the function)
.image

My Code:

$(function(){
$("div.portfolioImage").click(function(){
    var id = $(this).id;
    window.print($(this).id);
    $("div#portfolioHolder").fadeOut('slow', function() {
        // Animation complete.
    });
    $("div#details").fadeIn('slow', function() {
        // Animation complete.
    });
    $("div.image").each.fadeOut('slow', function(){/*complete*/});
    $("div.image#"+id.toString()).fadeIn('slow', function(){/*complete*/});
});

});

— David

  • 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-05-28T20:23:25+00:00Added an answer on May 28, 2026 at 8:23 pm

    IDs should be unique! But you can use data-id or any data-X instead…

    Instead of:

    <div class="portfolioImage" id="3">...</div>
    <div class="image" id="3">...</div>
    

    use:

    <div class="portfolioImage" id="image3">...</div>
    <div class="image" data-id="image3">...</div>
    

    and the JS:

    $('.portfolioImage').click(function(){
       var id = $(this).attr('id');
    
       $('.image').fadeOut('slow');
       $('.image[data-id='+id+']').fadeIn('slow');
       $('#portfolioHolder').fadeOut('slow');
       $('.details').fadeIn('slow');
    });
    

    should be right

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

Sidebar

Related Questions

I'm having troubles finding the code for this: I have this array: $filtros['code'] =
I'm having trouble with this code: NSRect itemFrame; id item; // code to assign
I am having some trouble with this code . The problem is when i
I'm a rookie designer having a few troubles with this page: http://www.resolvegroup.co.nz/javasurvey.php There are
I'm having trouble figuring this out. If I have a checkboxlist inside a usercontrol,
I'm having troubles getting this to work. Basically I have a python program that
I'm having troubles when calling a function taking a pointer to a string as
I am having troubles with my class which reads and writes data to a
I am attempting to interop to this simple scala code, but am having some
I'm having some troubles debugging this and getting a resolution. My data is being

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.