MouseY on click of a GoView in Firefox

G’day



This problem only occurs in Firefox…works fine in IE and Chrome…



I have a GoView inside a scrollable div (where overflow=scroll). When I click on the GoView, the click is sent relative to where the div is placed (ie, if the div’s top=100px and the user clicks at 50px below the top of the div, the the click will be sent to the GoView at y = 150px). However if I remove the overflow attribute, the click is sent to the right location.



I’ve debugged through GoWeb.js, and found that in the following function, e.target.y is zero:



function goMouseY(e) {

if (goIE) return e.offsetY; else return (e.pageY - e.target.y);

}



Any ideas?



Cheers,

Dave.

I’m able to reproduce using the sample code I wrote for you, so I’ll take a look.

Does it seem really slow to respond to the clicks in Firefox, or is that something about my system and debugging environment?

In Firefox, even without scrolling the DIV, I’m finding that I have to click (more or less) in the upper half of the Collapsible items to get it to select the one I’m clicking on. Are you seeing that too?

try this:
function goMouseY(e) {
/*if (goIE) return e.offsetY; else return (e.pageY-e.target.y);*/
if (e.offsetY) return e.offsetY; else return e.layerY;
}
same change in goMouseX as well.
seems to work in IE and Firefox... I haven't tried the others yet.

G’day Jake



That worked a treat!



Thanks again for your help,

Dave.

Hi again Jake…



FYI, e.layerY worked great for scrollable divs, but it was returning zero for divs that have no scrolling set.

I played around with the line you sent to allow e.pageY-e.target.y as well:



function goMouseY(e) {

if (e.offsetY) {

return e.offsetY;

} else {

if (e.target.y) {

return (e.pageY - e.target.y);

} else {

return e.layerY;

}

}

}



Now everything works perfect!



Cheers,

Dave.

I’ll go back and take a close look at this before I make any changes to the next version.