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

The Archive Base Latest Questions

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

I need a script, preferably jquery, to do the follwoing: I HAVE FOUR LITTLE

  • 0

I need a script, preferably jquery, to do the follwoing:

I HAVE FOUR LITTLE SQUARES (i.e. div tags) each a different color nested together to make ONE LARGE SQAURE.

WHEN I HOVER OVER ONE SMALL SQUARE, IT ENLARGES AND COVERS THE ENTIRE NEST. When I move away the mouse, the enlarged sqaure will go back to its original size in the nest.

I hope you understand this.

Is there a script that will do this?

A similar idea of the animation and resizing is found on the Sprint website:
link text

But I want the animation of the enlarged square to cover the three other squares in the nest.

Many thanks to everyone.

Erik

  • 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-15T22:42:29+00:00Added an answer on May 15, 2026 at 10:42 pm

    This should do what you want:

    HTML

    <div class="nest">
        <div class="square red"></div>  
        <div class="square blue"></div> 
        <div class="square green"></div> 
        <div class="square yellow"></div> 
    </div>    
    

    CSS

    /* Creates the coordinate system for absolutely positioned squares */
    .nest {
        position: relative;
        width: 200px;
        height: 200px;
    }
    
    .square {
        position: absolute;
        z-index: 1;
        width: 100px;
        height: 100px;
    }
    
    .red {
        top: 0;
        left: 0;
        background-color: red;
    }
    
    .blue {
        top: 0;
        left: 100px;
        background-color: blue;
    }
    
    .green {
        top: 100px;
        left: 0;
        background-color: green;
    }
    
    .yellow {
        top: 100px;
        left: 100px;
        background-color: yellow;
    }
    

    jQuery

    $('.square').each(function(){
    
        var origTop = $(this).offset().top;
        var origLeft = $(this).offset().left;
    
        $(this).hover(
            /* mouseover */
            function(){
                $(this).css({zIndex: 2});
                $(this).stop();
                $(this).animate({
                    top: 0,
                    left: 0,
                    width: 200,
                    height: 200
                });
            },
            /* mouseout */
            function(){
                $(this).stop();
                $(this).animate({
                    top: origTop,
                    left: origLeft,
                    width: 100,
                    height: 100
                }, function(){
                    $(this).css({zIndex: 1});  
                });
            }
        );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script with infinite loop. I need this script running forever.
I have a fileA with a snippet of code, and I need a script
I have a script that checks the value of a Div Id. <div id=hour
I have a php script which i would need the following 3 web browsers
I need to generate multiple databases to SQL, so I need script/program to automatically
I need a script that will test an input field's contents to see if
I need a script that simply formats a value (eg 4567643) to (4,567,643). No
I need a script to copy only the changed/modified and new files from my
I need a script to convert a comma seperated csv file to an excel
I need a script that inserts a number at some point into a file

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.