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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:30:57+00:00 2026-06-11T21:30:57+00:00

I have the basic idea of my JavaScript operational. The point of my JavaScript

  • 0

I have the basic idea of my JavaScript operational.

The point of my JavaScript is to make an image of id ‘player’ move to the position that I click with the mouse, only when I click on the div with the id of ‘stage’ with the animation lasting 3 seconds.

At the same time, when the animation is running the head should change to ‘player is moving’ as opposed to when it is still and displaying ‘player is still’.

Right now, in Chrome (maybe its a bug with Chrome) the basic functionality of the JS works. However, it seems to overshoot the position of where I click the mouse on the first round and then barely move when I click again in the ‘stage’ div.

If anyone sees where I might be running into a problem please let me know!

Here’s my EDITED JQuery:

$(document).ready(function(){
$('#stage').click(function(e){
    $('#header h1').html('Player is moving!');
    $('#player').animate({
        top: e.pageY + 'px',
        left: e.pageX + 'px'
    }, 3000, function(){
        $('#header h1').html('Player is standing still...');
    });     
});

});

I have fixed my CSS issue, so don’t worry about that but the code is located below for the CSS in case anyone thinks the issue may lie within.

Thanks!

EDIT:

Here’s the CSS. The issue has been solved but it has been provided for convenience if you think the issue of the image overshooting the image may lie within for any reason:

#header {
width: 600px;
margin: 20px auto 10px;
padding: 5px;
background-color: whiteSmoke;
border: 1px solid #aaa;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
box-shadow: 0 0 5px #ccc;
}
#header h1 {
text-align: center;
margin: 0;
}
#stage {
overflow: hidden;
width: 600px;
height: 400px;
margin: 0 auto;
padding: 5px;
background-color: whiteSmoke;
border: 1px solid #aaa;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: 0 0 5px #ccc;
position: relative;
}
#player {
position: absolute;
width: 36px;
}
  • 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-11T21:30:59+00:00Added an answer on June 11, 2026 at 9:30 pm

    Poor man’s example : jsfiddle but it works in FF and Chrome.
    Also, I’m curious what styles you lose, simple color style is always applied.

    So more information is needed, can you share the complete css?

    Update: I’m still not seeing an issue in chrome (with the fiddle example)
    Change #stage to something like

    #stage {width:600px;height:600px;background-color:#333;position:fixed;top:20;left:0;}
    

    Your player vs page is lying about it’s position or where you can click. I wanted the stage to be a fixed item on the page, non-moving. I don’t see any other reason (in your CSS or jQuery) why it’d overshoot.

    ​

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

Sidebar

Related Questions

the basic idea is that you have some class that has a reference type
I have several questions involving the interaction between JavaScript and MySQL. The basic idea
From a blog: The basic idea with CSS expressions is that you will have
The basic idea is this: I have a form that generates form fields dynamically
Ok, so the idea is that I have some javascript stuff happening (autcomplete) that
The basic idea is to have several questions, but only 1 showing randomly on
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I have some basic idea on how to do this task, but I'm not
I have a basic implementation of alpha-beta pruning but I have no idea how
I have a basic web service that returns the following object as JSON: public

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.