Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > onmousemove tracking works in IE - not in Firefox

Reply
Thread Tools

onmousemove tracking works in IE - not in Firefox

 
 
JJA
Guest
Posts: n/a
 
      04-27-2007
I've inherited some script that properly traces out a "rectangular
box" on a map in IE6 and IE7 but in Firefox the path of the mouse is
not visible. Could someone have a look and suggest something?

1. Browse to: http://gis.cbmiweb.com/MDWmaps/default.asp
2. Click the Zoom Box tool above the map (should change to yellow when
clicked)
3. Move mouse into map area and "draw" a zoom box by dragging out a
rectangle of choice

The zoom takes effect but the visible tracing of the rectangular zoom
box is only present with IE. With Firefox, there is no "feedback" to
the user while tracing out the "box".

I know the event model for FF is slightly different than IE. I think
the problem lies with the updateBand function in
http://gis.cbmiweb.com/MDWmaps/Scrip...t_Functions.js but I don't
know how to fix for Firefox. Here is a snippet of that code:

// update rubber band
function updateBand(evt) {
var band = locateElement("band");
if (band != null) {
// move band taking care of different browsers
if (ie) {
evt = event;
var map = locateElement("map");
if (evt.srcElement != map)
return;
band.style.pixelLeft = selectMin(bandX, evt.offsetX +
GetOffsetLeft(map));
band.style.pixelTop = selectMin(bandY, evt.offsetY +
GetOffsetTop(map));
band.style.width = selectMax(bandX, evt.offsetX +
GetOffsetLeft(map)) - band.style.pixelLeft;
band.style.height = selectMax(bandY, evt.offsetY +
GetOffsetTop(map)) - band.style.pixelTop;
} else {
band.style.left = selectMin(bandX, evt.pageX);
band.style.top = selectMin(bandY, evt.pageY);
band.style.width = selectMax(bandX, evt.pageX) -
parseInt(band.style.left);
band.style.height = selectMax(bandY, evt.pageY) -
parseInt(band.style.top);
}
}
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox doesn't process onmousemove 80s.arcade@videotron.ca Javascript 7 09-07-2006 12:07 PM
firefox onmousemove and dragging issues davefromalbury Javascript 8 01-13-2006 10:51 AM
Tracking Someone Tracking Me Edw. Peach Computer Security 4 07-07-2005 05:50 PM
document.onmousemove not working quite right help? Gary Mayor Javascript 3 03-04-2004 12:58 PM
onmousedown onmousemove events not working correctly!!! Jippie Javascript 0 01-23-2004 12:02 PM



Advertisments