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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:56:50+00:00 2026-05-26T18:56:50+00:00

I am animating an image from the exact center to a specific position in

  • 0

I am animating an image from the exact center to a specific position in the top left. To do this, I need to use an absolute positioning. However, in the following situation, it does not start out centered. A solution to this would be making the position relative, but then the animation does not work. And if I do something like left: 35%, it is only centered on MY screen. How can I fix this issue?

<style>
#Intro {
position: relative;
height:100%;
width:100%;
text-align:center;
}

#Picture {
position: absolute;
top: 30%;
}
</style>

<script src="http://code.jquery.com/jquery-1.7.min.js" type="text/javascript"></script>

<script  type="text/javascript">
    $(window).ready(function() {
    var pos = $('#Picture').position();
    $('#Picture').css({
        top: pos.top + 'px',
        left: pos.left + 'px'
    }).fadeIn(1000).delay(1500).animate({
        'top': '25px',
        'left': '20px',
        'height': '101px'
    }, 2000, 'swing');
});
</script>

<META HTTP-EQUIV=Refresh CONTENT="4.5; URL=home.html">
    <link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="Intro">
<img src="images/Triplid Logo.png" id="Picture"/>
</div>
  • 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-26T18:56:51+00:00Added an answer on May 26, 2026 at 6:56 pm

    If you want the image to be hidden initially, fade in at the absolute center of the window, then shrink to the top left hand corner, then the following will do that.

    Note the simple formula to set the initial position of the image, and the use of display: none; to hide the image initially.

    CSS:

    #Intro {
        position: relative;
        height:100%;
        width:100%;
        text-align:center;
    }
    
    #Picture {
        position: absolute;
        display: none;
    }
    

    Javascript:

    $(window).ready(function() {
        var $img = $('#Picture');
        $img.css({
            left: ($(window).width() - $img.width()) / 2,
            top: ($(window).height() - $img.height()) / 2
        }).fadeIn(1000).delay(1500).animate({
            'top': '25px',
            'left': '20px',
            'height': '101px'
        }, 2000, 'swing');
    });
    

    jsFiddle proof: http://jsfiddle.net/greglockwood/67Z6K/1/

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

Sidebar

Related Questions

I am using SnowFall app, in which a image is falling from top of
I wrote a sample code for image transforming from top to bottom, by using
I'm animating an image a certain amount from one menu button. It slides out
In my application i get image from server and those image build animation.this all
i have a very simple animation in flash CS4. My image travels from point
I have this code which should create a splash image with either no animation
I m un-animating a list using this code... function unanimate_li() { $li.filter(':last') .animate({ height:
I have a nested oredered list which i m animating using this code... var
I want to open a GIF image from the python console in Linux. Normally
Ttl;dr: I need to move an image VERY slowly in canvas without obvious pixel

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.