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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:19:50+00:00 2026-06-15T19:19:50+00:00

The below shown is the format of my html code. In the header div

  • 0

The below shown is the format of my html code. In the header div i have a image. Each box(box1, box2, box3) inside the contain div has link inside like(software development(box1), Graphic Designing(box2), and Technical Training(box3). These links when clicked will take me to separate pages which has their own header images. So i have 3 header image for each box and a default header image in the home page.In the home page when ever I hover my mouse in the box1 div the header image should change to the box1 header image with an effect like fadeIn and return my default image on mouse out. Same for box2 and box3. Please help me with doing this with CSS or JS or jQuery. Thank You

<body>
   <div class="wrapper">
      <div class="out">
         <div class="in">
            <div id="header"></div>
            <div class="contain">
               <div class="box1"></div>
               <div class="box2"></div>
               <div class="box3"></div>
            </div>
         </div>
      </div>
   </div>
</body>

css:

.wrapper{
    width: 100%
    height: auto;
    margin: 0px;
}
.out{
    margin: auto;
    width: 1000px;
    height: 730px;
    border-top: 5px solid  #333333;
}
.in{
    width: 900px;
    height: 640px;
    margin: auto;
    margin-top: 25px;
}
#header{
    background:url(../img/Untitled-1.jpg);
    height: 175px;
    width: 900px;
    margin: 0px;
}
.contain{
    margin: 0px;
    width: 900px;
    height: 428px;
}
.box1{
    height: 360px;
    width: 295px;
    float: left;
    margin: 67px 0px 0px 0px;
    position: absolute;
    background-color: #e6e7e9;
    border-bottom: 4px solid #735d8c;
}
.box2{
    height: 360px;
    width: 295px;
    float: left;
    margin: 67px 0px 0px 302px;
    position: absolute;
    background-color: #e6e7e9;
    border-bottom: 4px solid #735d8c;
}
.box3{
    height: 360px;
    width: 295px;
    float: left;
    margin: 67px 0px 0px 602px;
    position: absolute;
    background-color: #e6e7e9;
    border-bottom: 4px solid #735d8c;
}
  • 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-15T19:19:52+00:00Added an answer on June 15, 2026 at 7:19 pm

    jsBin demo

    jQuery:

    var currPage = 0; // PLAY HERE: set here current page (0 = home)
    
    var $header = $('#header');
    var $headerImg = $header.find('img');
    
    $headerImg.eq( currPage ).show().addClass('currentImg');
    
    // clone images to boxes:
    var c = 0;
    $('.box').each(function( i ){
    
      $(this).prepend( $headerImg.eq(i==currPage? (i+1+c++) : c+i).clone() );
    });
    
    
    $('.box img[class^=headImg]').on('mouseenter mouseleave', function( e ){
      
      var opacity = e.type=='mouseenter' ? 1 : 0 ;
      var myClass = $(this).prop('class'); // get class  
      var $mainImg = $header.find('img.'+myClass);
      
      
      $headerImg.hide();
      $mainImg.stop().fadeTo(300, opacity);
      $('.currentImg').stop().fadeTo(600, !opacity);
       
      
    });
    

    HTML:

    <div class="wrapper">
      <div class="out">
    
         <div class="in">
           
            <div id="header">
              <img class="headImg1" src="home.jpg" alt="" />
              <img class="headImg2" src="ONE.jpg" alt="" />
              <img class="headImg3" src="TWO.jpg" alt="" />
              <img class="headImg4" src="THREE.jpg" alt="" />
            </div>
           
            <div class="contain">
               <div class="box">
              
              </div>
               <div class="box">
              
              </div>
               <div class="box">
              
              </div>
            </div>
           
         </div>
        
        
      </div>
     </div>
    

    MODIFIED CSS PART:

    /*ADDED*/
    #header img{
      position:absolute;
      display:none;
    }
    
    
    .contain{
        margin: 0px;
        width: 900px;
        height: 428px;
    }
    .box{ /* CHANGED */
        height: 360px;
        width: 294px;
        float: left;
        margin: 67px 3px 0px;
        position: relative;
        background-color: #e6e7e9;
        border-bottom: 4px solid #735d8c;
    }
    
    /* ADDED */
    .box img{
      width:100%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the below shown html i have this main div as cxfeeditem feeditem and
I have a CSV file in the format shown below, and I'm using the
In the code shown below, how to get the values of multiselect box in
The html table coding structure looks something like the code shown below <table> <tr>
I have a newbie question. The Ruby code below returns JSON shown in Output1.
I have class like this below shown. which contains the shopping items where the
In the code shown below, I need to manipulate the time var in python
I have a table as shown below. It has accounts of type Fixed and
I created a custom function shown below with code I copied from a button
The code below kinda works except yes.com is shown as valid while I need

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.