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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:28:30+00:00 2026-05-15T16:28:30+00:00

I have 2 #header elements with different info in each that I want to

  • 0

I have 2 #header elements with different info in each that I want to fade in/out on a hover event.

I can do the fade in/out no problem BUT I really want the elements to be hidden, i.e. using “display:none;” AFTER they have faded out and THEN bring them back once they fade in.

I have this already for the fade:

$(document).ready(function()
{ 

  $("#header").hover
   (function()
   {
    $(this).fadeTo("fast", 0);
     $('#header_hover').fadeTo("fast", 1.0);    
   },
   function()
   {
    $(this).fadeTo("fast", 1.0); 
     $('#header_hover').fadeTo("fast", 0); '5'});      

   });

 });

Which works great but although this changes the ‘opacity’ of each item they still exist together in code, so its as if I have 2 headers which I don’t want.

FYI I’m using this CSS to show one header behind the other:

    #header, #header_hover
{
 height:260px;
 padding:0;
 margin:20px 10px;
 position:absolute;
 top:20px;
}

#header
{
 background:red;
 z-index:10;
}
#header_hover
{
 background:blue; 
 z-index:5;
}

I’ve tried a number of different solutions in jQuery, nothing has worked. At worst I get a crazy look at best one shows but the other is hidden forever?

  • 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-15T16:28:31+00:00Added an answer on May 15, 2026 at 4:28 pm

    You just have to show #header_hover before fading in (normally), and hide #header after fading out (using a callback).

    $("#header").hover(function() {
        $(this).fadeTo("fast", 0);
        $('#header_hover').show();
        $('#header_hover').fadeTo("fast", 1.0);    
    }, function() {
        $(this).fadeTo("fast", 1.0);
        $('#header_hover').fadeTo("fast", 0, function() {
            $(this).hide();
        });               
    });
    

    Try it here (Note: The red div has less content, so you can see the effect.).

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

Sidebar

Related Questions

I have two elements, I want to apply same background style, but different font
I have a header menu and try to define different CSS classes for each
my site has three div elements, header, content and footer. i have a picture
I have a header file, lets say Common.h, that is included in all of
I have the following problem: I have to list several items each with several
I want to make each one of these element is different line, without using
I want position elements to flow under each other when resizing the window, I
I'm wondering about standards or commonalities for various common elements on webpages that have
The form below can contains different elements of text fields, drop down and selection
I have a nav-menu on which it seems that I can't add a space

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.