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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:43:58+00:00 2026-05-26T08:43:58+00:00

I am fairly new to jQuery and I wanted to ask a question. Basically

  • 0

I am fairly new to jQuery and I wanted to ask a question. Basically I have four links that when clicked fade in a div with a jQuery function. What I would like to do is create a function so that when you click on one link all other divs fade out. So when I click on a link to fade in a div any other div whether it is one, two or three will fade out and open up the new div.

How would I do this???

Thanks!

J Winton

  • 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-26T08:43:59+00:00Added an answer on May 26, 2026 at 8:43 am

    This would be easier to answer with more specifics, but let’s assume your divs are differentiated by id. Furthermore, let’s assume the links point to a fragment identifier that gives the id of the div you wish to fade in

    $(something).click(function () {
        var target = $(this).attr('href').split("#")[1], // edit: removed the incorrect argument.
            $divs = $("div[id]"); // all divs with ids
    
        $divs.not("#"+target).fadeOut(); // Fade out other divs
        $divs.filter("#"+target).fadeIn(); // Fade in targeted div
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to jQuery and I have this overlay window that pops
I am fairly new to jquery and I have a question about updating data
I fairly new to JQuery and perhaps trying to achieve something that might be
I'm fairly new to jQuery and I'm having trouble with an animation that I'd
I am fairly new to JQuery API. I have been using mouseover, but I
I'm fairly new to jquery and struggling with something that should be fairly simple.
I'm fairly new to jQuery and I'm using the script below. Basically it uses
(I'm fairly new to jQuery.) I have a traditional HTML form with 3 drop-down
I'm fairly new to Javascript/JQuery. I'm trying to write an app that takes text
I'm fairly new to jquery and so far i have got my code to

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.