aximbigfan Posted June 16, 2008 Share Posted June 16, 2008 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 More sharing options...
haku Posted June 16, 2008 Share Posted June 16, 2008 Not if you don't tell us what you mean by 'doesn't work'. Link to comment https://forums.phpfreaks.com/topic/110357-code-to-get-mouse-cords-not-working/#findComment-566260 Share on other sites More sharing options...
aximbigfan Posted June 17, 2008 Author Share Posted June 17, 2008 It says addEvent is not a valid function... Chris Link to comment https://forums.phpfreaks.com/topic/110357-code-to-get-mouse-cords-not-working/#findComment-566991 Share on other sites More sharing options...
haku Posted June 17, 2008 Share Posted June 17, 2008 Sorry, can't help with that one. I don't know about addEvent. What are you trying to do? Link to comment https://forums.phpfreaks.com/topic/110357-code-to-get-mouse-cords-not-working/#findComment-567082 Share on other sites More sharing options...
aximbigfan Posted June 17, 2008 Author Share Posted June 17, 2008 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 https://forums.phpfreaks.com/topic/110357-code-to-get-mouse-cords-not-working/#findComment-567260 Share on other sites More sharing options...
haku Posted June 18, 2008 Share Posted June 18, 2008 By cords do you mean co-ords, as in co-ordinates? - not that I will be able to help you after you reply , I'm still out on this one. But maybe the clarification will help someone else be able to help you. Link to comment https://forums.phpfreaks.com/topic/110357-code-to-get-mouse-cords-not-working/#findComment-567744 Share on other sites More sharing options...
aximbigfan Posted June 18, 2008 Author Share Posted June 18, 2008 coordinates... Thanks! Chris Link to comment https://forums.phpfreaks.com/topic/110357-code-to-get-mouse-cords-not-working/#findComment-568198 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.