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

  • Home
  • SEARCH
  • 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 6119079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:30:37+00:00 2026-05-23T15:30:37+00:00

I’m creating an animated landing page using jQuery. In the animation when the mouse

  • 0

I’m creating an animated landing page using jQuery.enter image description here

In the animation when the mouse is over a section of the image (which is sliced),
it pops out. Up till now I have been able to do this only if I set the sections’ positions to absolute. If they are not positioned absolute, they move once I enlarge and move out one of the sections.

Is there any way to get this effect without seting position to absolute?

Thank you!

Edit: This is the code I’m using

$(".block").mousemove(function () {
    $(this).css("z-index", "1010");
    $(this).stop().animate({
        "width": "170px",
        "height": "400px",
        "top": "-12px",
        "left": "-13px"
    }, {
        duration: 300,
        easing: "swing",
        queue: true
    });
});

$(".block").mouseleave(function () {
    $(this).stop().animate({
        "width": "149px",
        "height": "374px",
        "top": "0px",
        "left": "0px"
    }, {
        duration: 500,
        easing: "swing",
        queue: true,
        complete: function () {
            $(this).css("z-index", "1000");
        }
    });
});
  • 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-23T15:30:38+00:00Added an answer on May 23, 2026 at 3:30 pm

    A solution to your question could be this:

    Right now each image is placed beside one another, right? Instead, try placing just white blocks beside one another as the placeholders to keep the dimensions and then place the images inside those boxes.

    I don’t know your actual html code, but I can see you have six blocks in your example picture.

    Below I have tried to set up a hover event on a very simple html box structure from the script you gave. In your script you had something about the z-index value and something to happen when complete. I have deleted that, since I couldn’t get the meaning of it or see it work with stop(), but you might edit this to match your wishes.

    Also I don’t use much class or id, but that might be needed at a larger page.
    EDIT: Make sure your divs have the exact same dimensions as the image they contain.

    HTML

    <div id="blocks">
    
        <!--The divs are the blocks - the imgs are the content-->
        <div><img src="block1.png"></div>
        <div><img src="block2.png"></div>
        <div><img src="block3.png"></div>
        <div><img src="block4.png"></div>
        <div><img src="block5.png"></div>
        <div><img src="block6.png"></div>
    
    </div>
    

    CSS

    div#blocks { /*The wrapping box*/
        height: 200px;
        width: 300px;
        /*Remember to add paddings, margins, borders etc.*/
    }
    
    div#blocks div { /*Creating the blocks*/
        position: relative;
        float: left;
        height: 200px;
        width: 50px;
    }
    
    /*The images now fill nothing at all*/
    div#blocks img {
        position: absolute;
        top: 0;
        left: 0;
    }
    

    Javascript

    $("div#blocks img").hover(
    
        function(){ /*On mousein*/
        $(this).stop().animate({
    
            "width": $(this).width() + 20, /*Enlarging by 20 x 20px*/
            "height": $(this).width() + 20,
            "top": "-10px", /*Keeping image centeret*/
            "left": "-10px",
            "z-index": "10"
    
            }, {
    
            duration: 300,
            easing: "swing",
            queue: true
    
            });
        },
        function(){ /*On mouseout*/
        $(this).stop().animate({
    
            "width": $(this).width(), /*Returning to original size*/
            "height": $(this).width(),
            "top": "0px", /*Keeping image centeret*/
            "left": "0px",
            "z-index": "0"
    
            }, {
    
            duration: 500,
            easing: "swing",
            queue: true
    
            });
        }
    
    );
    

    PS: Untested, but quite simple. You can give it a try.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.