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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:04:14+00:00 2026-06-06T21:04:14+00:00

I am tying to animate two face images using CSS3. They are horizontally aligned,

  • 0

I am tying to animate two face images using CSS3. They are horizontally aligned, and should move towards each other. My current jsfiddle is not working for some reason.

What’s wrong with it?

<div id="screen">
    <div id="animation-01">
        <div class="face_turn_around">
            <img id="imgR" src="http://www.centerwow.com/stackoverflow/face/face_right.png"
            />
            <img id="imgL" src="http://www.centerwow.com/stackoverflow/face/face_left.png"
            />
        </div> <!-- END face_turn_around -->
    </div> <!-- END animation-01-->
</div> <!-- end TSCREEN -->

​ #screen {
    background: blue;
    border:1px solid #eee;
    height:300px;
    width:200px;
    top:15px;
    left:15px;
    margin:0;
    overflow:hidden;
    padding:0;
    position:relative;
}
#imgL {
    position:absolute;
    margin-left:25px;
    margin-top:25px;
    width:30px;
}
#imgR {
    position:absolute;
    margin-right:25px;
    margin-top:25px;
    width:30px;
}
@-webkit-keyframes face_turn_left {
    from {
        -webkit-transform: translate(0px, 0px);
    }
    to {
        -webkit-transform: translate(50px, 0px);
    }
}
@-webkit-keyframes face_turn_right {
    from {
        -webkit-transform: translate(0px, 0px);
    }
    to {
        -webkit-transform: translate(50px, 100px);
    }
}
#animation-01 {
    position:relative;
    -webkit-animation-name:face_turn_left;
    -webkit-animation-name:face_turn_right;
    -webkit-animation-duration:10s;
    -webkit-animation-iteration-count:1;
    -webkit-animation-timing-unction:function:linear;
    -webkit-animation-delay:1s;
}
  • 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-06T21:04:15+00:00Added an answer on June 6, 2026 at 9:04 pm
    1. position:absoulte in #imgL and #imgR should be position:absolute;
    2. #animation-01 needs position:relative;. Otherwise, the faces would be positioned absolutely relative to #screen.

    Updated fiddle (I changed delay to 1s so that you don’t have to wait): http://jsfiddle.net/hfuGx/7/

    When you want to have a separate animation for the two images, you need to attach the animation to the <img> elements, not on the parent. You can use two animations, or use one animation, where only 100% (aka to) is set.

    @-webkit-keyframes face_turn {
        to {left:50px;}
    }
    

    Currently, when your animation ends, the element goes back to its original state. If you want to maintain the last state, use the animation-fill-mode property:

    #imgL, #imgR {
        -webkit-animation-name: face_turn;
        -webkit-animation-duration: 10s;
        -webkit-animation-iteration-count: 1;
        -webkit-animation-timing-function: ease-in-out;
        -webkit-animation-delay: 1s;
        -webkit-animation-fill-mode: forwards; /* <-- This*/
    }
    

    Fiddle: http://jsfiddle.net/hfuGx/14/

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

Sidebar

Related Questions

I'm trying to animate two images moving across the screen using Monotouch. I've been
I am trying to animate the blinking between two images on an imageview to
Im trying to get two alpha-24 transparent .png files to crossfade into each other.
I'm trying to use jquery to animate between two images, fading one out then
I´m trying to animate a sort of draggable UIView where the behaviour should be
I am trying to animate a div moving 200px horizontally in JavaScript. The code
I am trying to put two .animate() in my main animate() callback. Not working?
I am trying to animate a couple of images across a screen. Ideally I
I'm trying to animate object. I use keyframe animation: I have two vertex buffers
I am trying to find a way to animate two views in this way:

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.