Jump to content

Code to get mouse cords not working?


aximbigfan

Recommended Posts

I have this code:

function trackingout(evt)
{
if(evt)
{
var elem = (evt.target) ? evt.target :evt.srcElement;
if(elem.id = "trackingbar") 
{
var cpos = evt.offsetX;
var perc = (cpos / 3)-1;
page("?trackpos="+ perc);
}
}
}


addEvent(window, "load", function() { addEvent(document.body, "mousedown", function(evt) 
{ 
trackingout(evt);
}
);
}

 

However it does not work. Any ideas?

 

Chris

Link to comment
Share on other sites

I have a WinAMP remote control, and one of the things is that there is a tracking bar, where it says how far along the media is. I want the user to be able to click on the bar, then have the mouse cords taken, and then make an ajax request with that data. EVERYTHING but this is figured out, and it is getting so annoying because this should be simple, I just need the mouse cords.

 

 

Thanks,

Chris

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.