onmousemove tracking works in IE - not in Firefox

Discussion in 'Javascript' started by JJA, Apr 27, 2007.

  1. JJA

    JJA Guest

    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/Scripts/Client_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);
    }
    }
    }
     
    JJA, Apr 27, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Csaba2000
    Replies:
    6
    Views:
    507
  2. Jippie
    Replies:
    0
    Views:
    113
    Jippie
    Jan 23, 2004
  3. Gary Mayor
    Replies:
    3
    Views:
    284
    Rob Swindells
    Mar 4, 2004
  4. davefromalbury

    firefox onmousemove and dragging issues

    davefromalbury, Jan 9, 2006, in forum: Javascript
    Replies:
    8
    Views:
    250
    Thomas 'PointedEars' Lahn
    Jan 13, 2006
  5. Replies:
    7
    Views:
    141
    Randy Webb
    Sep 7, 2006
Loading...

Share This Page