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
https://forums.phpfreaks.com/topic/110357-code-to-get-mouse-cords-not-working/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.