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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:29:50+00:00 2026-05-13T20:29:50+00:00

EDIT: Solved My problem is that I need to find a way to constantly

  • 0

EDIT: Solved

My problem is that I need to find a way to constantly read x,y coordinates of the cursor in my browser onmousedown and then to quit reading the x,y coordinates onmouseup here is what I have so far:


var mouseDown = 0;
var xPos = 0;
var yPos = 0;

document.body.onmousedown = function() { 
  mouseDown = 1;
}
document.body.onmouseup = function() {
  mouseDown = 0;
}
function resize(width, height){
    document.getElementById('component1').width=width;
    document.getElementBYId('component1').height=height;
}
function setSize(){
    while(mouseDown == 1)
    {
        xPos = event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        yPos = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? 
document.documentElement.scrollTop : document.body.scrollTop);
        resize(xPos, yPos);
    }
    
}

Any suggestions?

  • 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-13T20:29:51+00:00Added an answer on May 13, 2026 at 8:29 pm

    Have a look at http://javascript.internet.com/page-details/mouse-coordinates.html for a working example

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

Sidebar

Related Questions

[EDIT: Problem solved. Please see my answer below.] In my app I call the
edit: Solved - mod_rewrite was the problem I can't get CI to work as
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
Edit: [Solved] : It seems that the getTableCellRendererComponent of the CustomTableCellRenderer is called every
EDIT: Actually I realized that what I need is the value of X. Let
It would seem that there is a much simpler way to state the problem.
I have a head aching problem that I can't seem to find an easy
Edit: Problem solved. Make it global. I'm doing a facepalm right now guys. Thanks!
I searched and couldn't find a solution that was unique to my problem. I
edit: I was trying to solve a spoj problem. Here is the link to

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.