C
Csaba2000
The following code has me so confused, I don't even know
the right questions to ask. Opera 7.01 and IE 5.5 both
exhibit behaviours I don't understand while NN 6.1 seems
to ignore me altogether.
The upshot: .style.cursor seems to be ignored under
certain circumstances.
Let's take something that's mostly repeatable and maybe
someone can explain to me what's happening. In Opera 7.01
starting from the outside of the table shown, move the mouse,
slowly, left, enter the bottom border (from the bottom right
of the table) always moving left, and staying on the bottom border.
What I imagined should happen is that we should get a
single onmouseover event followed by a bunch of
onmousemove events. Indeed, near as I could tell, that's
what happens, but just in case, window.doneP=false
enforces this when coupled with if (window.doneP) return;
My observed behaviour is that the cursor changes to
what is set in the onmouseover event handler, but
not to what is set in the onmousemove handler, till
it is jostled off the bottom border. It's almost as if the
cursor is allowed to change only once per the element
becoming active.
I've been staring at what IE is doing for hours, but I
can't get consistent enough behaviour to report properly.
It'd be great if someone could offer some comments
about this.
Thanks,
Csaba Gabor from New York
PS. The motivation on this is that I'm going to want to
change the cursor to a hand when the cursor is over any
part of the (internal or external) table border that is NOT
at the intersection of two borders (ie. the little squares
where a horizontal and vertical border come together are
not allowed since there the border verticalness or
horizontalness is not uniquely determined). I'm able
to determine these locations quite nicely (thanks Richard),
but the cursors are not always changing as assigned.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<META http-equiv="content-type" content="text/html;charset=iso-8859-1">
<TITLE>Opera Cursor issue demo</TITLE>
<SCRIPT type="text/javascript">
function statusBar (msg) {
document.getElementById("statusBar").innerText = msg; }
function setCur() {
// done with setTimeout just in case timing is involved.
aTables = document.getElementsByTagName("TABLE");
aTables[0].style.cursor="s-resize";
}
function mouseOver(elem) {
statusBar('MouseOver');
if (window.doneP) return;
window.doneP=true;
elem.style.cursor='hand';
}
</SCRIPT>
</HEAD>
<BODY onLoad="window.doneP=false" bgcolor=gold style="margin:5%">
<TABLE border onmouseover="mouseOver(this)"
onmousemove="window.setTimeout('setCur()',50);statusBar('MouseMove');"
onmouseout="statusBar('Off table')">
<TR>
<TD>foo</TD>
<TD>bar</TD>
<TD rowspan=2>tall col</TD>
</TR><TR>
<TD rowspan=2>tall col 2</TD>
<TD colspan=2>middle Row</TD>
</TR><TR>
<TD>This is a lot of baz</TD>
<TD>frob</TD>
</TR>
</TABLE>
<BR><BR>
<SPAN id="statusBar" style="color:red"></SPAN>
</BODY>
</HTML>
the right questions to ask. Opera 7.01 and IE 5.5 both
exhibit behaviours I don't understand while NN 6.1 seems
to ignore me altogether.
The upshot: .style.cursor seems to be ignored under
certain circumstances.
Let's take something that's mostly repeatable and maybe
someone can explain to me what's happening. In Opera 7.01
starting from the outside of the table shown, move the mouse,
slowly, left, enter the bottom border (from the bottom right
of the table) always moving left, and staying on the bottom border.
What I imagined should happen is that we should get a
single onmouseover event followed by a bunch of
onmousemove events. Indeed, near as I could tell, that's
what happens, but just in case, window.doneP=false
enforces this when coupled with if (window.doneP) return;
My observed behaviour is that the cursor changes to
what is set in the onmouseover event handler, but
not to what is set in the onmousemove handler, till
it is jostled off the bottom border. It's almost as if the
cursor is allowed to change only once per the element
becoming active.
I've been staring at what IE is doing for hours, but I
can't get consistent enough behaviour to report properly.
It'd be great if someone could offer some comments
about this.
Thanks,
Csaba Gabor from New York
PS. The motivation on this is that I'm going to want to
change the cursor to a hand when the cursor is over any
part of the (internal or external) table border that is NOT
at the intersection of two borders (ie. the little squares
where a horizontal and vertical border come together are
not allowed since there the border verticalness or
horizontalness is not uniquely determined). I'm able
to determine these locations quite nicely (thanks Richard),
but the cursors are not always changing as assigned.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<META http-equiv="content-type" content="text/html;charset=iso-8859-1">
<TITLE>Opera Cursor issue demo</TITLE>
<SCRIPT type="text/javascript">
function statusBar (msg) {
document.getElementById("statusBar").innerText = msg; }
function setCur() {
// done with setTimeout just in case timing is involved.
aTables = document.getElementsByTagName("TABLE");
aTables[0].style.cursor="s-resize";
}
function mouseOver(elem) {
statusBar('MouseOver');
if (window.doneP) return;
window.doneP=true;
elem.style.cursor='hand';
}
</SCRIPT>
</HEAD>
<BODY onLoad="window.doneP=false" bgcolor=gold style="margin:5%">
<TABLE border onmouseover="mouseOver(this)"
onmousemove="window.setTimeout('setCur()',50);statusBar('MouseMove');"
onmouseout="statusBar('Off table')">
<TR>
<TD>foo</TD>
<TD>bar</TD>
<TD rowspan=2>tall col</TD>
</TR><TR>
<TD rowspan=2>tall col 2</TD>
<TD colspan=2>middle Row</TD>
</TR><TR>
<TD>This is a lot of baz</TD>
<TD>frob</TD>
</TR>
</TABLE>
<BR><BR>
<SPAN id="statusBar" style="color:red"></SPAN>
</BODY>
</HTML>